当前位置: 首页>>代码示例>>PHP>>正文


PHP DataType::Character方法代码示例

本文整理汇总了PHP中DataType::Character方法的典型用法代码示例。如果您正苦于以下问题:PHP DataType::Character方法的具体用法?PHP DataType::Character怎么用?PHP DataType::Character使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataType的用法示例。


在下文中一共展示了DataType::Character方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

function login()
{
    if ($email == null) {
        echo "E-Mail is a required field.";
    } else {
        if ($pass == null) {
            echo "Password is a required field.";
        } else {
            ProgressIndicator::Show();
            $url = "http://demo.kikapptools.com/magento/apiKikApp/api.php?metodo=login";
            $httpClient_post = new httpClient();
            $httpClient_post->addVariable('email', $email);
            $httpClient_post->addVariable('password', $pass);
            $result = $httpClient_post->Execute('POST', $url);
            $customerToken = new InputText();
            $userName = new InputText();
            $response = array("customerToken" => DataType::Character(150), "userName" => DataType::Character(150));
            Data::FromJson($response, $result);
            $customerToken = $response['customerToken'];
            $userName = $response['userName'];
            ProgressIndicator::Hide();
            if ($customerToken != "") {
                StorageAPI::Set("token", $customerToken);
                StorageAPI::Set("userName", $userName);
                AndroidAction::GoHome();
            } else {
                echo "Invalid user";
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:31,代码来源:Login.php

示例2: login

function login()
{
    if ($username == null) {
        echo "E-Mail is a required field.";
    } else {
        if ($password == null) {
            echo "Password is a required field.";
        } else {
            ProgressIndicator::Show();
            $url = "http://demo.kikapptools.com/Gastos/crud/Login.php";
            $httpClient_post = new httpClient();
            $inputMetodo = new InputText();
            $inputMetodo->setValue("login");
            $httpClient_post->addVariable('username', $username);
            $httpClient_post->addVariable('password', $password);
            $result = $httpClient_post->Execute('POST', $url);
            $id_user = new InputText();
            $struct = array("response" => DataType::Character(50));
            Data::FromJson($struct, $result);
            $id_user = $struct['response'];
            ProgressIndicator::Hide();
            if ($id_user != "0") {
                StorageAPI::Set("token", $id_user);
                AndroidAction::GoHome();
            } else {
                echo "Wrong user or password";
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:30,代码来源:Login.php

示例3: save

function save()
{
    if ($email == null) {
        echo "EMail is a required field.";
    } else {
        if ($password == null) {
            echo "Password is a required field.";
        } else {
            if ($password != $password_2) {
                echo "Please make sure your passwords match.";
            } else {
                ProgressIndicator::Show();
                $url = "http://demo.kikapptools.com/Gastos/crud/Register.php";
                $http = new httpClient();
                $http->addVariable('username', $email);
                $http->addVariable('passcode', $password);
                //lo de pasar la clave a md5 lo hace el Register.php
                $result = $http->Execute('POST', $url);
                $struct = array("id_usuario" => DataType::Character(101));
                Data::FromJson($struct, $result);
                $id_user = new InputText(100);
                $id_user = $struct['id_usuario'];
                if ($id_user == "0") {
                    echo "User already signed up";
                } else {
                    echo "Signed up succesfully.";
                    StorageAPI::Set("token", $id_user);
                    AndroidAction::GoHome();
                }
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:33,代码来源:Register.php

示例4: save

function save()
{
    if ($username == null) {
        echo "E-Mail is a required field.";
    } else {
        if ($password == null) {
            echo "Password is a required field.";
        } else {
            if ($password != $password2) {
                echo "Please make sure your passwords match.";
            } else {
                ProgressIndicator::Show();
                $url = "http://demo.kikapptools.com/Gastos/crud/updateUser.php";
                $httpClient_post = new httpClient();
                $inputMetodo = new InputText();
                $inputMetodo->setValue("login");
                $httpClient_post->addVariable('username', $username);
                $httpClient_post->addVariable('password', $password);
                $httpClient_post->addVariable('id', $token);
                $result = $httpClient_post->Execute('POST', $url);
                $id_user = new InputText();
                $struct = array("response" => DataType::Character(50));
                Data::FromJson($struct, $result);
                $id_user = $struct['response'];
                ProgressIndicator::Hide();
                AndroidAction::GoHome();
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:30,代码来源:Settings.php

示例5: load_data

function load_data()
{
    $url = "http://www.devxtend.com/Gecko/samples/3_2/rest/main_load_data";
    $hc = new httpClient();
    $rs = $hc->Execute("GET", $url);
    $struct = array(array("id" => DataType::Character(6), "name" => DataType::Character(100)));
    Data::FromJson($struct, $rs);
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:8,代码来源:main.php

示例6: 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);
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:8,代码来源:IncomeOutcome.php

示例7: loadCity

function loadCity()
{
    $url = "http://demo.kikapptools.com/HttpClientEjemplo/crud/getCity.php";
    $httpClient = new httpClient();
    $result = $httpClient->Execute('GET', $url);
    $struct = array("nombreCiudad" => DataType::Character(150));
    Data::FromJson($struct, $result);
    $city = $product['nombreCiudad'];
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:9,代码来源:main.php

示例8: start

function start()
{
    $url = "http://demo.kikapptools.com/CRMManager/crud/getCompanies.php?companyId=" . $id;
    $httpClient = new httpClient();
    $result = $httpClient->Execute('GET', $url);
    $struct = array("CompanyName" => DataType::Character(100), "CompanyImage" => DataType::Character(200), "CompanyPhone" => DataType::Phone(), "CompanyAddress" => DataType::Address());
    Data::FromJson($struct, $result);
    $image = $struct['CompanyImage'];
    $name = $struct['CompanyName'];
    $address = $struct['CompanyAddress'];
    $phone = $struct['CompanyPhone'];
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:12,代码来源:view_company.php

示例9: load_image

function load_image()
{
    $url = "http://demo.kikapptools.com/magento/apiKikApp/ProductImages.php?pId=" . $id;
    $httpClient = new httpClient();
    echo $id;
    $result = $httpClient->Execute('GET', $url);
    $str_images = array(array("url" => DataType::Character(350)));
    Data::FromJson($str_images, $result);
    foreach ($str_images as $img) {
        $image = $img['url'];
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:12,代码来源:ProductImage.php

示例10: 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'];
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:12,代码来源:SubCategories.php

示例11: 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'];
    }
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:14,代码来源:main.php

示例12: 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'];
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:15,代码来源:list_companies.php

示例13: save

function save()
{
    if ($name == null) {
        echo "Name is a required field.";
    } else {
        if ($lastname == null) {
            echo "Last name is a required field.";
        } else {
            if ($email == null) {
                echo "E-Mail is a required field.";
            } else {
                if ($password == null) {
                    echo "Password is a required field.";
                } else {
                    if ($password != $password_2) {
                        echo "Please make sure your passwords match.";
                    } else {
                        ProgressIndicator::Show();
                        $url = "http://demo.kikapptools.com/magento/apiKikApp/api.php?metodo=createUser";
                        $http = new httpClient();
                        $http->addVariable('name', $name);
                        $http->addVariable('lastname', $lastname);
                        $http->addVariable('email', $email);
                        $http->addVariable('password', $password);
                        $rs = $http->Execute("POST", $url);
                        $sdt_rs = array("error" => DataType::Character(300));
                        Data::FromJson($sdtError, $rs);
                        $rs = new InputText(300);
                        $rs = $sdt_rs['error'];
                        ProgressIndicator::Hide();
                        if ($rs == "0") {
                            echo "User created successfully!";
                            $win->Open("Login");
                        } else {
                            echo $rs;
                        }
                    }
                }
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:42,代码来源:Register.php

示例14: 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'];
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:20,代码来源:ProductList.php

示例15: 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();
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:21,代码来源:main.php


注:本文中的DataType::Character方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。