本文整理汇总了PHP中DataType::Numeric方法的典型用法代码示例。如果您正苦于以下问题:PHP DataType::Numeric方法的具体用法?PHP DataType::Numeric怎么用?PHP DataType::Numeric使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataType
的用法示例。
在下文中一共展示了DataType::Numeric方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_cat
function load_cat()
{
$url = "http://demo.kikapptools.com/Gastos/crud/getCategories.php";
$hc = new httpClient();
$rs = $hc->Execute("GET", $url);
$struct = array(array("idCat" => DataType::Numeric(11), "name" => DataType::Character(80), "desc" => DataType::Character(200)));
Data::FromJson($struct, $rs);
}
示例2: clientStart
function clientStart()
{
$token = StorageAPI::Get("token");
$url = "http://demo.kikapptools.com/Gastos/crud/getAccount.php";
$httpClient = new httpClient();
$httpClient->addVariable("id", $token);
$result = $httpClient->Execute('POST', $url);
$struct = array("money" => DataType::Numeric(11));
Data::FromJson($struct, $result);
$input = $struct['money'];
}
示例3: load_grid
function load_grid()
{
$url = "http://demo.kikapptools.com/magento/apiKikApp/Categories.php?cId=" . $cat;
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
$struct = array(array("id" => DataType::Numeric(6), "name" => DataType::Character(150)));
Data::FromJson($struct, $result);
foreach ($struct as $product) {
$id = $product['id'];
$name = $product['name'];
}
}
示例4: load_images
function load_images()
{
$url = "http://demo.kikapptools.com/magento/apiGecko/productos.php?cId=0";
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
$struct = array(array("id" => DataType::Numeric(6), "name" => DataType::Character(150), "description" => DataType::Character(300), "pirce" => DataType::Character(10), "thumb" => DataType::Character(200)));
Data::FromJson($struct, $result);
foreach ($struct as $product) {
$id = $product['id'];
$title = $product['name'];
$desc = $product['description'];
$image = $product['thumb'];
}
}
示例5: Start
function Start()
{
//Make JSON request
$url = "http://demo.kikapptools.com/taskManager/crud/getTask.php?id=" . $id;
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
//Cast response data type
$struct = array("id" => DataType::Numeric(6), "task" => DataType::Character(150), "status" => DataType::Numeric(1), "image" => DataType::Character(200), "created_at" => DataType::Character(20), "description" => DataType::Character(254));
//Retrieve data to elements on screen
Data::FromJson($struct, $result);
$name = $struct['task'];
$status = $struct['status'];
$date = $struct['created_at'];
$description = $struct['description'];
}
示例6: load_companies
function load_companies()
{
$url = "http://demo.kikapptools.com/CRMManager/crud/getCompanies.php";
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
$struct = array(array("CompanyId" => DataType::Numeric(8), "CompanyName" => DataType::Character(100), "CompanyImage" => DataType::Character(200), "CompanyAddress" => DataType::Character(200)));
Data::FromJson($struct, $result);
$id = new InputNumeric();
foreach ($struct as $company) {
$id = $company['CompanyId'];
$image = $company['CompanyImage'];
$name = $company['CompanyName'];
$address = $company['CompanyAddress'];
}
}
示例7: load_grid
function load_grid()
{
//Make JSON request
$url = "http://demo.kikapptools.com/taskManager/crud/getTask.php?status=" . $statusList . "&period=" . $period;
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
//Cast response data type
$struct = array(array("id" => DataType::Numeric(6), "task" => DataType::Character(150), "status" => DataType::Numeric(1), "created_at" => DataType::Character(20)));
Data::FromJson($struct, $result);
//Add result to screen vars
foreach ($struct as $items) {
$id = $items['id'];
$name = $items['task'];
$status = $items['status'];
$date = $items['created_at'];
}
}
示例8: grid_load
function grid_load()
{
$url = "http://demo.kikapptools.com/magento/apiKikApp/Products.php?cId=" . $cat;
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
$struct = array(array("id" => DataType::Numeric(6), "name" => DataType::Character(150), "description" => DataType::Character(300), "pirce" => DataType::Character(10), "thumb" => DataType::Character(200), "stock" => DataType::Character(50), "href" => DataType::Character(300)));
Data::FromJson($struct, $result);
$prodUrl = new InputText();
$id = new InputNumeric();
$stock = new InputText();
foreach ($struct as $product) {
$id = $product['id'];
$title = $product['name'];
$desc = $product['description'];
$image = $product['thumb'];
$price = $product['pirce'];
$stock = $product['stock'];
$prodUrl = $product['href'];
}
}
示例9: grid_load_products
function grid_load_products()
{
$url_prod = "http://www.demo.kikapptools.com/magento/apiGecko/productos.php?cId=0";
//the server url
//Remember to configurate your server url on the Manifest.xml on <services>
$httpClient_prod = new httpClient();
$result_prod = $httpClient_prod->Execute('GET', $url_prod);
//you get a JSON
//it's a list so you have an array of an array
$struct_prod = array(array("id" => DataType::Numeric(6), "name" => DataType::Character(150), "description" => DataType::Character(300), "pirce" => DataType::Character(10), "thumb" => DataType::Character(200)));
Data::FromJson($struct_prod, $result_prod);
//does a merge of the structure you made and the json you got
foreach ($struct_prod as $product) {
$id_prod = $product['id'];
$title_prod = $product['name'];
$desc_prod = $product['description'];
$image_prod = $product['thumb'];
$price_prod = $product['pirce'];
}
$id_prod = new InputNumeric();
}
示例10: refresh
function refresh()
{
$url = "http://demo.kikapptools.com/Gastos/crud/getIncome.php?id=" . $token;
$httpClient = new httpClient();
$result = $httpClient->Execute('GET', $url);
$struct = array("account" => DataType::Numeric(11), "value_income" => DataType::Numeric(11), "value_outcome" => DataType::Numeric(11), "value_income_month" => DataType::Numeric(11), "value_outcome_month" => DataType::Numeric(11), "label_actual_month" => DataType::Character(20));
Data::FromJson($struct, $result);
$input_account = $struct['account'];
$input_income = $struct['value_income'];
$input_outcome = $struct['value_outcome'];
$input1 = $struct['value_income_month'];
$input2 = $struct['value_outcome_month'];
$label_title = $struct['label_actual_month'];
}
示例11: load_grid
function load_grid()
{
ProgressIndicator::Show();
$url = "http://demo.kikapptools.com/magento/apiKikApp/api.php?metodo=userShoppingCart&customerToken=" . $token;
$httpClient = new httpClient();
$result_2 = $httpClient->Execute('GET', $url);
$shoppingCart = array(array("id" => DataType::Numeric(), "name" => DataType::Character(), "sku" => DataType::Character(50), "quantity" => DataType::Numeric(4), "price" => DataType::Numeric(12, 4), "url" => DataType::Character(350)));
Data::FromJson($shoppingCart, $result_2);
foreach ($shoppingCart as $cart) {
$id = $cart["id"];
$name = $cart["name"];
$qty = $cart["quantity"];
$price = $cart["price"];
$image = $cart["url"];
}
ProgressIndicator::Hide();
}