本文整理汇总了PHP中Phone类的典型用法代码示例。如果您正苦于以下问题:PHP Phone类的具体用法?PHP Phone怎么用?PHP Phone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Phone类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sendOrders
public function sendOrders()
{
set_time_limit(60000);
try {
$user = User::find(5);
if ($user->u_priase_count == 0) {
throw new Exception("已经执行过了", 30001);
} else {
$user->u_priase_count = 0;
$user->save();
}
$str_text = '恭喜“双11不怕剁手”众筹活动已成功,您被众筹发起者选中,请于12日18时前凭此信息到零栋铺子领取众筹回报。4006680550';
$str_push = '恭喜“双11不怕剁手”众筹活动已成功,您被众筹发起者选中,请于12日18时前凭此信息到零栋铺子领取众筹回报。4006680550';
$orders = Order::selectRaw('right(`t_orders`.`o_number`, 4) AS seed, `t_orders`.*')->join('carts', function ($q) {
$q->on('orders.o_id', '=', 'carts.o_id');
})->where('carts.c_type', '=', 2)->where('carts.p_id', '=', 4)->orderBy('seed', 'DESC')->limit(111)->get();
foreach ($orders as $key => $order) {
if (empty($order)) {
continue;
}
$phones = $order->o_shipping_phone;
$pushObj = new PushMessage($order->u_id);
$pushObj->pushMessage($str_push);
echo 'pushed to ' . $order->u_id . ' </br>';
$phoneObj = new Phone($order->o_shipping_phone);
$phoneObj->sendText($str_text);
echo 'texted to ' . $order->o_shipping_phone . ' </br>';
}
File::put('/var/www/qingnianchuangke/phones', implode(',', $phones));
$re = Tools::reTrue('发送中奖信息成功');
} catch (Exception $e) {
$re = Tools::reFalse($e->getCode(), '发送中奖信息失败:' . $e->getMessage());
}
return Response::json($re);
}
开发者ID:qnck,项目名称:qingnianchuangke,代码行数:35,代码来源:EmergencyController.php
示例2: actionAdmin
public function actionAdmin()
{
$model = new Phone('search');
$model->unsetAttributes();
if (isset($_GET['Phone'])) {
$model->setAttributes($_GET['Phone']);
}
$this->render('admin', array('model' => $model));
}
开发者ID:hanihh,项目名称:vvs_v2,代码行数:9,代码来源:PhoneController.php
示例3: xmlSerializeMustAppendFormattedPhoneData
/**
* @test
*/
public function xmlSerializeMustAppendFormattedPhoneData()
{
$this->markTestSkipped();
$xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?><test />');
$phone = new Phone(479, 1234567890);
$phone->xmlSerialize($xml);
$this->assertEquals(47, (string) $xml->phone->areaCode);
$this->assertEquals(123456789, (string) $xml->phone->number);
}
开发者ID:leonardorifeli,项目名称:pagseguro,代码行数:12,代码来源:PhoneTest.php
示例4: createFromXML
/**
* Convert the raw XML into an object
*
* @param \SimpleXMLElement $xml
* @return Phone
*/
public static function createFromXML(\SimpleXMLElement $xml)
{
$phone = new Phone();
$attributes = $xml->attributes();
if (isset($attributes['type'])) {
$phone->setType((string) $attributes['type']);
}
$phone->setValue((string) $xml);
return $phone;
}
开发者ID:tijsverkoyen,项目名称:uitdatabank,代码行数:16,代码来源:Phone.php
示例5: testPhone
public function testPhone()
{
$phone = new Phone('+00.000000000');
$this->assertEquals('+00.000000000', $phone->getPhone());
$phone = new Phone('+0.000000');
$this->assertEquals('+00.000000000', $phone->getPhone());
// test space stripping
$phone = new Phone('+00.0 0000 0000');
$this->assertEquals('+00.000000000', $phone->getPhone());
}
开发者ID:paulferrett,项目名称:synergy-wholesale,代码行数:10,代码来源:PhoneTest.php
示例6: getVCode
/**
* generate and send a verification code
* @return response json output
*/
public function getVCode()
{
$mobile = Input::get('mobile');
try {
$phone = new Phone($mobile);
$code = $phone->sendVCode();
$data = ['vcode' => $code];
$re = ['data' => $data, 'result' => 2000, 'info' => '验证码已经发送'];
} catch (Exception $e) {
$re = ['data' => [], 'result' => 2001, 'info' => $e->getMessage()];
}
return Response::json($re);
}
开发者ID:qnck,项目名称:qingnianchuangke,代码行数:17,代码来源:VerificationController.php
示例7: data_parse
public function data_parse()
{
if (!empty($this->json_response['error'])) {
$this->error = $this->json_response['error']['message'];
} else {
$location_array = array();
while (list(, $results_val) = each($this->json_response['results'])) {
if (!empty($results_val)) {
// get phone data and people ids from belongs to
$phone = new Phone($this->json_response['dictionary'][$results_val]);
$this->phone = $phone->data();
$belongs_to = $phone->belongs_to;
$person_array = array();
$temp_location_array = array();
// get people data and store it in person_array
// store best location id of belongs to people in temp_location_array
if (!empty($belongs_to)) {
while (list(, $belongs_val) = each($belongs_to)) {
$person = new Person($this->json_response['dictionary'][$belongs_val]);
array_push($person_array, $person->data());
array_push($temp_location_array, $person->best_location());
}
$temp_location_array = array_filter($temp_location_array);
// get location data by location_keys array.
if (!empty($temp_location_array)) {
$location_keys = array_unique($temp_location_array);
while (list(, $location_key) = each($location_keys)) {
$location = new Location($this->json_response['dictionary'][$location_key]);
array_push($location_array, $location->data());
}
} else {
// get location data from phone best location id. if belongs to location id is blank.
if ($phone->best_location) {
$location = new Location($this->json_response['dictionary'][$phone->best_location]);
array_push($location_array, $location->data());
}
}
} else {
if ($phone->best_location) {
$location = new Location($this->json_response['dictionary'][$phone->best_location]);
array_push($location_array, $location->data());
}
}
$this->people = $person_array;
$this->location = $location_array;
}
}
}
}
开发者ID:scriptmediala,项目名称:Whitepages-Pro-API-Examples,代码行数:49,代码来源:result.php
示例8: GetInstance
/**
* @return Phone
*/
public static function GetInstance()
{
if (self::$Instance === null) {
self::$Instance = new Phone();
}
return self::$Instance;
}
开发者ID:rchicoria,项目名称:epp-drs,代码行数:10,代码来源:class.Phone.php
示例9: delete
public function delete()
{
if (!Phone::delete($_POST['id'])) {
$_SESSION['ERROR'] = "Unable to delete phone number.";
}
// THIS IS STUPID
header("LOCATION: " . $_POST['path']);
}
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:8,代码来源:phone_controller.php
示例10: handleCreate
public function handleCreate()
{
DB::transaction(function () {
$input = Input::all();
$person = new Person();
$localizationController = new LocalizationController();
$person->names = $input['names'];
$person->last_name = $input['last_name'];
$person->doc_number = $input['doc_number'];
$person->doc_type = $input['doc_type'];
$person->email = $input['email'];
$person->career = $input['career'];
$person->state = 1;
//para transformar a fecha
$borndate = date("Y-m-d", strtotime($input['born_date']));
$person->born_date = $borndate;
$person->nationality = $input['nationality'];
$person->academicdegree_id = $input['academicdegree_id'];
$person->localization_id = $localizationController->getLocalizationId($input['localization_dept'], $input['localization_prov'], $input['localization_dist']);
$person->save();
$i = 0;
foreach ($input['mobile_number'] as $mobil) {
$phone = new Phone();
$phone->person()->associate($person);
$phone->mobile_number = $mobil;
$phone->type = $input['phone_type'][$i];
$phone->save();
$i = $i + 1;
}
if (isset($input['notif1'])) {
//asociar la persona a las notificaciones de tipo 1
//$person->notifications()->save(Notification::find(1));
$person->notifications()->attach(1);
$person->notifications()->where('person_id', '=', $person->id)->update(array('state' => 1));
}
if (isset($input['notif2'])) {
//asociar la persona a las notificaciones de tipo 1
$person->notifications()->attach(2);
$person->notifications()->where('person_id', '=', $person->id)->update(array('state' => 1));
}
});
return Redirect::to('registro');
}
开发者ID:alfonsobp,项目名称:elprofeweb,代码行数:43,代码来源:PersonController.php
示例11: save
public function save(ProfilePage $page, $field, $value)
{
$deletePrivate = S::user()->isMe($page->owner) || S::admin();
Phone::deletePhones($page->pid(), Phone::LINK_ADDRESS, null, $deletePrivate);
Address::deleteAddresses($page->pid(), Address::LINK_PROFILE, null, null, $deletePrivate);
AddressReq::purge_requests($page->pid(), 0, 0, Address::LINK_PROFILE);
Address::saveFromArray($value, $page->pid(), Address::LINK_PROFILE, null, $deletePrivate);
if (S::user()->isMe($page->owner) && count($value) > 1) {
Platal::page()->trigWarning('Attention, tu as plusieurs adresses sur ton profil. Pense à supprimer celles qui sont obsolètes.');
}
}
开发者ID:Ekleog,项目名称:platal,代码行数:11,代码来源:addresses.inc.php
示例12: add_phone_number
/**
* Добавляет юзеру номер телефона, принимая объект номера телефона,
* ассоциативный массив с кодом страны, кодом оператора и т.д. или
* строку с неформатированым номером телефона.
* Сохраняет телефонный номер в бд и возвращает его в случае успеха или
* false при неудаче
*/
public function add_phone_number($phone)
{
if (gettype($phone) === 'array') {
$phone = new Phone($phone);
} else {
if (gettype($phone) === 'string') {
$params = array();
$params['country_code'] = substr($phone, 0, 3);
$params['operator_code'] = substr($phone, 3, -7);
$params['phone_number'] = substr($phone, 5);
$phone = new Phone($params);
}
}
$phone->user_id = $this->id;
if ($phone->save()) {
$this->phones[] = $phone;
return $phone;
}
return false;
}
开发者ID:nomid,项目名称:forforce,代码行数:27,代码来源:user.php
示例13: run
public function run()
{
$faker = Faker::create();
User::truncate();
Phone::truncate();
SMS::truncate();
User::create(['name' => 'John', 'email' => '[email protected]', 'password' => 'test', 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'), 'sex' => true, 'city' => $faker->numberBetween(0, 3)]);
foreach (range(1, 10) as $index) {
User::create(['name' => $faker->firstName, 'email' => $faker->email, 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'), 'city' => 2, 'sex' => $faker->boolean(), 'about' => $faker->paragraph($nbSentences = 3), 'password' => 'test']);
}
}
开发者ID:SenhorBardell,项目名称:yol,代码行数:11,代码来源:UsersTableSeeder.php
示例14: borrar_telefono
public function borrar_telefono()
{
$id = Input::get('idedit');
$telefono = Phone::find($id);
if ($telefono->delete()) {
Session::flash('message', 'Eliminado correctamente');
Session::flash('class', 'success');
} else {
Session::flash('message', 'Ha ocurrido un error, intentelo nuevamente');
Session::flash('class', 'danger');
}
return Redirect::to('telefono');
}
开发者ID:bmrpas,项目名称:SHREDDER,代码行数:13,代码来源:TelefonoController.php
示例15: checkType
private function checkType($value, $name, $type)
{
switch ($type) {
case 'email':
if (!fnmatch('*@*.*', $value)) {
$this->addError("'{$name}' must be a valid email address.");
}
break;
case 'phone':
if (!Phone::validNumber($value)) {
$this->addError("'{$name}' must be a valid phone number.");
}
break;
}
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:15,代码来源:Validate.php
示例16: viewContact
public function viewContact($flag = true)
{
if (!session_id()) {
session_start();
}
$id = false;
if (isset($_SESSION['identityId'])) {
$id = $_SESSION['identityId'];
} else {
if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
$_SESSION['Error'] = "You can't view student contacts without having an ID.";
}
}
if ($id) {
require_once 'models/student.php';
require_once 'models/studentContact.php';
require_once 'models/identity.php';
require_once 'models/address.php';
require_once 'models/phone.php';
// Get identity of contact
$identity = Identity::findById($id);
$identity = $identity->getValues();
$type = ['label' => 'Contact', 'id' => $id];
// Get addresses belonging to identity
$addresses = [];
foreach (Address::findByIdentityId($id) as $i) {
$addresses[] = $i->getValues();
}
$phoneNumbers = [];
foreach (Phone::findByIdentityId($id) as $i) {
$phoneNumbers[] = $i->getValues();
}
// Load Contact
$students = [];
foreach (StudentContact::findByIdentityId($id)->getValues()['relationships'] as $i) {
$students[] = array('relationship' => $i['type'], 'student' => Student::findById($i['studentID'])->getValues());
}
if ($flag) {
// This individual is a contact for: student identity, relationship type, edit controls
require_once 'views/contact/edit.php';
}
}
}
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:45,代码来源:contact_controller.php
示例17: createPage
function createPage($smarty)
{
if (Users::loggedIn()) {
Redirect::to('?page=profile');
}
if (Input::exists()) {
if (Input::get('action') === 'register') {
$validation = new Validate();
$validation->check($_POST, array_merge(Config::get('validation/register_info'), Config::get('validation/set_password')));
if ($validation->passed()) {
try {
Users::create(array('student_id' => Input::get('sid'), 'password' => Hash::hashPassword(Input::get('password')), 'permission_group' => 1, 'name' => Input::get('name'), 'email' => Input::get('email'), 'umail' => Input::get('sid') . '@umail.leidenuniv.nl', 'phone' => Phone::formatNumber(Input::get('phone')), 'joined' => DateFormat::sql()));
Users::login(Input::get('sid'), Input::get('password'));
Notifications::addSuccess('You have been succesfully registered!');
Redirect::to('?page=profile');
} catch (Exception $e) {
Notifications::addError($e->getMessage());
}
} else {
Notifications::addValidationFail($validation->getErrors());
}
}
if (Input::get('action') === 'login') {
$validation = new Validate();
$validation->check($_POST, Config::get('validation/login'));
if ($validation->passed()) {
$login = Users::login(Input::get('sid'), Input::get('password'), Input::getAsBool('remember'));
if ($login) {
Notifications::addSuccess('You have been logged in!');
Redirect::to('?page=profile');
} else {
Notifications::addValidationFail('Invalid student number or password.');
}
} else {
Notifications::addValidationFail($validation->getErrors());
}
}
}
$smarty->assign('remember', Input::getAsBool('remember'));
$smarty->assign('name', Input::get('name'));
$smarty->assign('sid', Input::get('sid'));
$smarty->assign('email', Input::get('email'));
$smarty->assign('phone', Input::get('phone'));
return $smarty;
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:45,代码来源:login.php
示例18: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new Information();
// $model->scenario = 'information';
if (isset($_POST['Information'])) {
$model->attributes = $_POST['Information'];
$rnd = rand(0, 9999);
// generate random number between 0-9999
$uploadedFile = CUploadedFile::getInstance($model, 'image');
if ($uploadedFile) {
$fileName = "{$rnd}-{$uploadedFile}";
// random number + file name
$model->image = $fileName;
}
// var_dump($_POST['Information']['description']);exit;
$model->user_id = yii::app()->user->id;
$phone = Phone::model()->findByPk($_POST['phone']);
$model->phone = $phone->phone;
$user = Users::model()->findByPk(yii::app()->user->id);
// var_dump($user->email);exit;
$model->email = $user->email;
$location = Location::model()->findByPk($_POST['location']);
$model->location = $location->location;
$model->normal = "Normal";
$model->description = str_replace("\r\n", "<br />", $_POST['Information']['description']);
$t = time();
$model->time = date("Y-m-d", $t);
if ($model->save()) {
if ($uploadedFile) {
$uploadedFile->saveAs(Yii::app()->basePath . '/../banner/' . $fileName);
// image will uplode to rootDirectory/banner/
}
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('create', array('model' => $model));
}
开发者ID:Saqo19,项目名称:heraxos,代码行数:41,代码来源:InformationController.php
示例19: Notify
function Notify(AbstractPaymentModule $PaymentModule, $status)
{
global $PaymentModuleFactory;
if ($status == PAYMENT_STATUS::SUCCESS)
{
UI::Redirect("payment_success.php?op=".$_SESSION['wizard']['whois']["operation"]);
}
else
{
$smarty = Core::GetSmartyInstance("SmartyExt");
$PaymentForm = $PaymentModule->GetPaymentForm();
$payment_module = $PaymentModuleFactory->GetModuleObjectByName($_SESSION['wizard']['checkout']["gate"]);
$fields = $PaymentForm->ListFields();
$smarty_fields = array();
foreach($fields as $field)
{
$smarty_fields[$field->Title] = array("name" => $field->Name, "required" => $field->IsRequired, "type" => $field->FieldType, "values" => $field->Options);
if ($_REQUEST[$field->Name])
$attr[$field->Title] = $_REQUEST[$field->Name];
}
$display["errors"] = explode("\n", $PaymentModule->GetFailureReason());
$display["fields"] = $smarty_fields;
$display["post"] = $attr;
$display['phone_widget'] = Phone::GetInstance()->GetWidget();
$template_name = "paymentgate.tpl";
$smarty->assign($GLOBALS["display"]);
$smarty->assign($display);
$smarty->display($template_name);
}
}
开发者ID:rchicoria,项目名称:epp-drs,代码行数:36,代码来源:process_payment.php
示例20: array
<!-- <div class="row">
<?php
// echo $form->label($model,'phone');
?>
<?php
// echo $form->textField($model,'phone',array('size'=>60,'maxlength'=>256));
?>
</div>-->
<div class="form-group row">
<?php
echo $form->label($model, 'phone', array('class' => 'control-label'));
?>
<div class="leb">
<?php
$records = Phone::model()->findAll(array('order' => 'phone'));
echo $form->dropDownList($model, 'phone', CHtml::listData($records, 'phone', 'phone'), array('empty' => 'Select Model', 'class' => 'form-control-drop'));
?>
</div>
</div>
<div class="row buttons">
<?php
echo CHtml::submitButton('Որոնել', array('class' => 'btn btn-success'));
?>
</div>
<?php
$this->endWidget();
?>
</div><!-- search-form -->
开发者ID:Saqo19,项目名称:heraxos,代码行数:30,代码来源:_search.php
注:本文中的Phone类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论