本文整理汇总了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";
}
}
}
}
示例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";
}
}
}
}
示例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();
}
}
}
}
}
示例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();
}
}
}
}
示例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);
}
示例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);
}
示例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'];
}
示例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'];
}
示例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'];
}
}
示例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'];
}
}
示例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'];
}
}
示例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'];
}
}
示例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;
}
}
}
}
}
}
}
示例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'];
}
}
示例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();
}