本文整理汇总了PHP中Address::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::insert方法的具体用法?PHP Address::insert怎么用?PHP Address::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::insert方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* 保存新建国家信息
*
* @access public
*/
function add_save()
{
//查询国家是否已存在
$country = get_post_value('country');
if (!$this->verify()) {
echo '<br>大区 ' . $country . ' 已存在,请核对后重新输入。<a href="javascript:history.go(-1)">返回</a><br>';
return;
}
$status = get_post_value('status');
$field = array('country' => trim($country), 'orders' => get_post_value('orders'), 'status' => $status == '10000' ? '10000' : '30000');
$m = new Address();
$m->clear();
$m->setTable('vcb_address_country');
//设置表名
$m->setField($field);
//设置更新字段及值,(键值数组)
$data = $m->insert();
//插入数据
if (!$data) {
//插入数据是否成功。
echo '<br>保存失败<br>';
} else {
echo '<br>保存成功,<a href="add">继续添加</a>,<a href="index">返回</a><br>';
}
}
示例2: insertProcess
function insertProcess()
{
$valid = Validator::make(array('send.firstname' => 'min:1|slashes', 'send.lastname' => 'min:1|slashes', 'send.groupid' => 'number|slashes', 'send.username' => 'min:3|slashes', 'send.email' => 'email|slashes', 'address.address_1' => 'slashes', 'address.address_2' => 'slashes', 'address.city' => 'slashes', 'address.state' => 'slashes', 'address.postcode' => 'slashes', 'address.country' => 'slashes'));
if (!$valid) {
throw new Exception("Error Processing Request: " . Validator::getMessage());
}
$username = Request::get('send.username');
$email = Request::get('send.email');
$loadData = Users::get(array('where' => "where username='{$username}' OR email='{$email}'"));
if (isset($loadData[0]['userid'])) {
throw new Exception("This user have been exist in database.");
}
$send = Request::get('send');
$address = Request::get('address');
$thepass = Request::get('thepass');
$passMd5 = String::encrypt($thepass);
$send['password'] = $passMd5;
$address['firstname'] = $send['firstname'];
$address['lastname'] = $send['lastname'];
$userid = Users::insert($send);
$address['userid'] = $userid;
Address::insert($address);
}
示例3: makeRegister
public static function makeRegister($inputData = array())
{
if (!isset($_REQUEST['send']['firstname']) && isset($inputData['firstname'])) {
$_REQUEST['send'] = $inputData;
}
$valid = Validator::make(array('send.firstname' => 'required|min:1|max:20|slashes', 'send.lastname' => 'required|min:1|max:20|slashes', 'send.username' => 'required|min:1|max:30|slashes', 'send.email' => 'required|email|max:120|slashes', 'send.password' => 'required|min:1|max:30|slashes'));
if (!$valid) {
throw new Exception("Check your infomartion again: " . Validator::getMessage());
}
$insertData = Request::get('send');
if (!($id = Users::insert($insertData))) {
throw new Exception("Check your infomartion again, pls!");
}
$addData = array('firstname' => trim($insertData['firstname']), 'lastname' => trim($insertData['lastname']), 'userid' => $id);
Address::insert($addData);
try {
self::newRegister($insertData);
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
}
示例4: array
/**
* 保存新建大区信息
*
* @access public
*/
function add_save()
{
//查询大区是否已存在
$country = get_post_value('country');
$region = get_post_value('region');
$orders = get_post_value('orders');
if (!$this->verify_region()) {
echo '<br>大区 ' . $_POST['region'] . ' 已存在,请核对后重新输入。<a href="javascript:history.go(-1)">返回</a><br>';
return;
}
//保存新增数据(设置column及值)
$field = array('country_id' => $country, 'region' => $region, 'orders' => $orders, 'status' => isset($_POST['status']) ? '10000' : '30000');
$m = new Address();
$m->clear();
$m->setTable('vcb_address_region');
$m->setField($field);
//设置更新字段及值,(键值数组)
$data = $m->insert();
//插入数据
if (!$data) {
//插入数据是否成功。
echo '<br>保存失败<br>';
} else {
echo '<br>保存成功,<a href="add?country=' . $country . '&orders=' . ($orders + 1) . '">继续添加</a>,<a href="index">返回</a><br>';
}
}
示例5: array
/**
* 保存新建大区信息
*
* @access public
*/
function add_save()
{
$country = get_post_value('country');
$region = get_post_value('region');
$province = get_post_value('province');
$city = get_post_value('city');
$orders = get_post_value('orders');
$status = get_post_value('status');
if (!$this->verify()) {
echo '<br>省 ' . $city . ' 已存在,请核对后重新输入。<a href="javascript:history.go(-1)">返回</a><br>';
return;
}
//保存新增数据(设置column及值)
$field = array('province_id' => $province, 'city' => $city, 'orders' => $orders, 'status' => $status == '10000' ? '10000' : '30000');
$m = new Address();
$m->clear();
$m->setField($field);
$m->setTable('vcb_address_city');
$data = $m->insert();
if (!$data) {
echo '<br>保存失败<br>';
} else {
echo '<br>保存成功,<a href="add?country=' . $country . '®ion=' . $region . '&province=' . $province . '&orders=' . ($orders + 1) . '">继续添加</a>,<a href="index">返回</a><br>';
}
}
示例6: catch
Flight::ok($array);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('GET /v1/main/address/@id', function ($id) {
try {
$object = Address::select($id);
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('POST /v1/main/address', function () {
try {
$object = Address::insert();
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('PUT /v1/main/address/@id', function ($id) {
try {
$object = Address::update($id);
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('DELETE /v1/main/address/@id', function ($id) {
try {
示例7: searchByUserid
<title><?php
echo $strDeliveryAddr;
?>
</title>
<?php
include "css.php";
$dbcat = $GLOBALS["dbcatalog"];
$dbusercat = $GLOBALS["dbusercat"];
$tab = 1;
// If submitted
if ($submitted and isset($action)) {
$nUser = searchByUserid($dbusercat, $matUser, $matAddr, $matComp, "", $userid, 1);
$objAddr = new Address($dbusercat);
$objAddr->setFields('D', $matUser[0]->CNPJ_CPF, $matUser[0]->{$compCNPJ}, 0, $cep, $street, $number, $complement, $district, $city, $state, $country);
$objAddr->setUserId($userid);
$objAddr->insert();
$auxact = $action;
// action é palavra reservada em Java.
?>
<!-- Inicializa as funções JavaScript -->
<script type="text/javascript">
goOn(<?php
echo "'" . $sesskey . "'";
?>
, <?php
echo "'" . $userid . "'";
?>
, <?php
echo "'" . $nItens . "'";
?>
, <?php