本文整理汇总了PHP中guid函数的典型用法代码示例。如果您正苦于以下问题:PHP guid函数的具体用法?PHP guid怎么用?PHP guid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了guid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: useradd
/**
* 新增用户
*
*/
public function useradd()
{
if ('POST' == I('server.REQUEST_METHOD')) {
$User = M('User');
$data = $_POST;
switch ($data['status']) {
case '1':
$data['status'] = 1;
break;
default:
$data['status'] = 0;
}
$data['password'] = md5($_POST['password']);
$data['create_time'] = date('Ymd H:i:s');
$data['update_time'] = date('Ymd H:i:s');
$data['remark'] = 'dd';
$data['last_login_ip'] = get_client_ip();
$data['token'] = guid();
$data['id'] = null;
if (!$User->create($data)) {
$this->error($User->getError());
} else {
if ($result = $User->add()) {
$this->crmSuccess('添加成功', U('index'));
} else {
$this->crmError('添加失败', U('useradd'));
}
}
} else {
$this->display();
}
}
开发者ID:yuhaizr,项目名称:Y2Game,代码行数:36,代码来源:UserController.class.php
示例2: execute
public function execute()
{
$request = $_REQUEST;
$data = $request['data'];
if (empty($data)) {
throw new Exception('Missing Data');
}
if (empty($data['uid'])) {
throw new Exception('Missing Uid');
}
if (empty($data['to_uid'])) {
throw new Exception('Missing to user id');
}
if (empty($data['subject'])) {
throw new Exception('Missing subject');
}
if (empty($data['message'])) {
throw new Exception('Missing message');
}
$message_id = guid();
$data['message_id'] = $message_id;
$Models_Messages = new Models_Messages();
$Models_Messages->add($data);
$this->return = array('confirm' => 'Message sent successfully.', 'message_id' => $message_id);
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:25,代码来源:add.class.php
示例3: register
public function register($username, $password, $email, $phone, $name)
{
global $connAdodb;
$sql = "select * from users where (username = " . $connAdodb->qstr($username) . " OR phone = " . $connAdodb->qstr($phone) . " OR email = " . $connAdodb->qstr($email) . ")";
$rs = $connAdodb->Execute($sql);
if ($rs->RecordCount() === 0) {
//insert here
$return['username'] = $username;
$return['password'] = $password;
$return['email'] = $email;
$return['phone'] = $phone;
$return['name'] = $name;
$return['user_id'] = guid();
$return['status'] = 1;
$return['created'] = tstobts(time());
$connAdodb->AutoExecute('users', $return, 'INSERT');
unset($return['password']);
return $return;
}
if ($rs->fields['username'] == $username) {
return 0;
}
if ($rs->fields['email'] == $email) {
return 1;
}
if ($rs->fields['phone'] == $phone) {
return 2;
}
return 3;
}
开发者ID:manishkhanchandani,项目名称:world_mkgxy,代码行数:30,代码来源:Users.class.php
示例4: insertCmsSite
public function insertCmsSite()
{
foreach ($this->sites as $v) {
$arr = array();
$a = $style = '';
if (!empty($v['ResourcePSN'])) {
$a = explode('}', $v['ResourcePSN']);
$a = substr($a[0], 5);
$arr['domain'] = $this->psn[$a]['URL'];
$arr['dirname'] = $this->dir[$v['Name']];
} else {
$arr['domain'] = '';
$arr['dirname'] = "html_{$v['NodeID']}";
}
$arr['siteid'] = $v['NodeID'];
$arr['name'] = $v['Name'];
$arr['site_title'] = $v['Name'];
$arr['uuid'] = guid();
$arr['setting'] = $this->setting;
if (!empty($v['IndexTpl'])) {
$v['IndexTpl'] = ltrim($v['IndexTpl'], "/");
$a = explode("/", $v['IndexTpl']);
$style = array_shift($a);
} else {
$style = 'default';
}
$arr['default_style'] = $style;
//$arr['template'] = array($style);
$arr['template'] = array('default');
$res[] = $arr;
}
return $res;
}
开发者ID:lestatmq,项目名称:cms,代码行数:33,代码来源:sites.php
示例5: guid
/**
* guid
*
* @return string(int)
*/
public static function guid()
{
static $list = array();
$time = explode(' ', microtime());
// 1338438896 => 2012-05-31 12:34:56
$guid = $time[1] - 1338438896 . sprintf('%06u', substr($time[0], 2, 6)) . substr(sprintf('%010u', mt_rand()), 0, 4);
return isset($list[$guid]) ? guid() : ($list[$guid] = $guid);
}
开发者ID:null-1,项目名称:fangtaitong,代码行数:13,代码来源:Util.php
示例6: add
function add($points, $itemId)
{
if ($points == null || $itemId == null) {
return false;
}
$remarkId = guid();
self::$model->getDatabase()->execute("INSERT INTO `njx_remarks` SET `remarkId`=?,`points`=?,`itemId`=?", array($remarkId, $points, $itemId));
return $this->selectOne($remarkId);
}
开发者ID:shiyake,项目名称:PHP,代码行数:9,代码来源:RemarksModel.php
示例7: agregarFamilia
public function agregarFamilia()
{
$datos_familia = array('id' => guid(), 'nombre' => $this->input->post('nombre'), 'descripcion' => $this->input->post('descripcion'), 'estado' => TRUE);
if ($this->familias->agregar((object) $datos_familia)) {
echo json_encode(TRUE);
} else {
echo json_encode(FALSE);
}
}
开发者ID:mxcoding,项目名称:sosbelladev,代码行数:9,代码来源:familias.php
示例8: agregarCategoria
public function agregarCategoria()
{
$categoria = array('idCategoria' => guid(), 'nombre' => $this->input->post('nombre'), 'descripcion' => $this->input->post('descripcion'), 'idFamilia' => $this->input->post('familia'));
if ($this->categorias->agregar((object) $categoria)) {
echo json_encode(TRUE);
} else {
echo json_encode(FALSE);
}
}
开发者ID:mxcoding,项目名称:sosbelladev,代码行数:9,代码来源:categorias.php
示例9: add
function add($name, $type, $tips = null, $selectorCount = null, $rangeFrom = null, $rangeTo = null, $rangeUnit = null)
{
if ($name == null || $type == null) {
return false;
}
$foid = guid();
self::$model->getDatabase()->execute("INSERT INTO `njx_fields_options` SET `foid`=?,`name`=?,`tips`=?,`type`=?,`selectorCount`=?,`rangeFrom`=?,`rangeTo`=?,`rangeUnit`=?", array($foid, $name, $tips, $type, $selectorCount, $rangeFrom, $rangeTo, $rangeUnit));
return $this->selectOne($foid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:9,代码来源:FieldsOptionsModel.php
示例10: add
function add($name, $value)
{
if ($name == null || $value == null) {
return false;
}
$sid = guid();
self::$model->getDatabase()->execute("INSERT INTO `njx_setting` SET `sid`=?,`name`=?,`value`=?", array($sid, $name, $value));
return $this->selectOne($sid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:9,代码来源:SettingModel.php
示例11: add
function add($foid, $value, $itemId)
{
if ($foid == null || $value == null || $itemId == null) {
return false;
}
$oid = guid();
self::$model->getDatabase()->execute("INSERT INTO `njx_fields` SET `oid`=?,`foid`=?,`value`=?,`itemId`=?", array($oid, $foid, $value, $itemId));
return $this->selectOne($oid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:9,代码来源:FieldsModel.php
示例12: add
function add($content, $image, $url)
{
if ($content == null || $image == null || $url == null) {
return false;
}
$aid = guid();
$display = 1;
self::$model->getDatabase()->execute("INSERT INTO `njx_ads` SET `aid`=?,`content`=?,`image`=?,`url`=?,`display`=?", array($aid, $content, $image, $url, $display));
return $this->selectOne($aid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:10,代码来源:AdsModel.php
示例13: add
function add($discuzId, $name, $privilege)
{
if ($discuzId == null || $name == null || $privilege == null) {
return false;
}
$uid = guid();
$createTime = date('H-m-d H:i:s', time());
self::$model->getDatabase()->execute("INSERT INTO `njx_users` SET `uid`=?,`discuzId`=?,`createTime`=?,`name`=?,`privilege`=?", array($uid, $discuzId, $createTime, $name, $privilege));
return $this->selectOne($uid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:10,代码来源:UsersModel.php
示例14: add
function add($itemId, $content)
{
if ($itemId == null || $content == null) {
return false;
}
$rid = guid();
$currentTime = date('Y-m-d H:i:s', time());
echo $currentTime;
self::$model->getDatabase()->execute("INSERT INTO `njx_comments` SET `rid`=?,`itemId`=?,`content`=?,`createTime`=?", array($rid, $itemId, $content, $currentTime));
return $this->selectOne($rid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:11,代码来源:CommentsModel.php
示例15: create
public function create()
{
$authinfo = $this->input['authinfo'];
$authinfo['status'] = 0;
$authinfo['appkey'] = guid('');
$re = $this->customcore->create('authinfo', $authinfo);
$custominfo = $this->input['custominfo'];
$custominfo['appid'] = $re['id'];
$this->customcore->create('custominfo', $custominfo);
$this->addItem('true');
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:12,代码来源:custom_manage_update.php
示例16: agregarFranquicia
public function agregarFranquicia()
{
$data_franquicia = aObjeto(array('IdFranquicia' => guid(), 'Clave' => $this->input->post('clave'), 'Nombre' => $this->input->post('nombre'), 'IdFranquiciatario' => $this->input->post('franquiciatario')));
if (!$this->franquicia->existe($data_franquicia->Clave)) {
if ($this->franquicia->agregar($data_franquicia)) {
echo json_encode(array('estatus' => TRUE, 'mensaje' => 'La franquicia se agrego correctamente'));
} else {
echo json_encode(array('estatus' => FALSE, 'mensaje' => 'Ocurrió un problema al agregar la franquicia'));
}
} else {
echo json_encode(array('estatus' => FALSE, 'mensaje' => 'La clave de la franquicia ya existe, verifíquelo'));
}
}
开发者ID:mxcoding,项目名称:sosbelladev,代码行数:13,代码来源:franquicias.php
示例17: agregarSucursal
public function agregarSucursal()
{
$data_sucursal = aObjeto(array('IdSucursal' => guid(), 'Clave' => $this->input->post('Clave'), 'Nombre' => $this->input->post('Nombre'), 'Direccion' => $this->input->post('Direccion'), 'IdFranquicia' => $this->input->post('IdFranquicia')));
if (!$this->sucursal->existe($data_sucursal->Clave)) {
if ($this->sucursal->agregar($data_sucursal)) {
echo json_encode(array('estatus' => TRUE, 'mensaje' => 'La sucursal se agregó correctamente'));
} else {
echo json_encode(array('estatus' => FALSE, 'mensaje' => 'Hubo un problema al agregar la sucursal'));
}
} else {
echo json_encode(array('estatus' => FALSE, 'mensaje' => 'La clave ya existe, verifíquelo'));
}
}
开发者ID:mxcoding,项目名称:sosbelladev,代码行数:13,代码来源:sucursales.php
示例18: add
function add($uid, $caid, $title)
{
if ($uid == null || $caid == null || $title == null) {
return false;
}
$iid = guid();
$order = $this->count() + 1;
$createTime = date('Y-m-d H:i:s', time());
$modifyTime = $createTime;
$isDeleted = '0';
$commentsCount = '0';
$status = '0';
self::$model->getDatabase()->execute("INSERT INTO `njx_items` SET `iid`=?,`order`=?,`createTime`=?,`modifyTime`=?,`uid`=?,`caid`=?,`isDeleted`=?,`commentsCount`=?,`status`=?,`title`=?", array($iid, $order, $createTime, $modifyTime, $uid, $caid, $isDeleted, $commentsCount, $status, $title));
return $this->selectOne($iid);
}
开发者ID:shiyake,项目名称:PHP,代码行数:15,代码来源:ItemsModel.php
示例19: execute
public function execute($request = array())
{
//coming soon
if (empty($request)) {
$request = $_REQUEST;
}
$data = array();
if (empty($request['module_id'])) {
throw new Exception('Missing module_id');
}
if (empty($request['user_id'])) {
throw new Exception('Missing user_id');
}
if (empty($request['city_id'])) {
throw new Exception('Missing City ID');
}
if (empty($request['title'])) {
throw new Exception('Missing title');
}
$data['record_id'] = guid();
$data['module_id'] = !empty($request['module_id']) ? $request['module_id'] : '';
$data['user_id'] = !empty($request['user_id']) ? $request['user_id'] : '';
$data['city_id'] = !empty($request['city_id']) ? $request['city_id'] : '';
$data['title'] = !empty($request['title']) ? $request['title'] : '';
$data['lat'] = !empty($request['lat']) ? $request['lat'] : '';
$data['lon'] = !empty($request['lng']) ? $request['lng'] : '';
$data['address'] = !empty($request['address']) ? $request['address'] : '';
$data['showAddress'] = !empty($request['showAddress']) ? $request['showAddress'] : 0;
$data['record_updated_date'] = date('Y-m-d H:i:s');
for ($i = 1; $i <= 10; $i++) {
$field = 'ifield' . $i;
$data[$field] = !empty($request[$field]) ? $request[$field] : NULL;
}
for ($i = 1; $i <= 2; $i++) {
$field = 'ffield' . $i;
$data[$field] = !empty($request[$field]) ? $request[$field] : NULL;
}
$data['details'] = json_encode($request['details']);
$model = new Models_Records();
$returnData = $model->add($data);
//add categories
$model->add_category($data['record_id'], $request['categories']);
$this->return = array('confirm' => 'New posting created successfully', 'record_id' => $data['record_id'], 'data' => $data, 'returnData' => $returnData);
return $this->return;
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:45,代码来源:add.class.php
示例20: __construct
/**
* 析构函数
*/
function __construct()
{
$this->model["guid"] = guid();
$this->model["id"] = 0;
$this->model["weight"] = 99;
$this->model["pid"] = 0;
$this->model["title"] = '';
$this->model["seotitle"] = '';
$this->model["keywords"] = '';
$this->model["description"] = '';
$this->model["urlname"] = '';
$this->model["info"] = '';
$this->model["pic"] = '';
$this->model["content"] = '';
$this->model["insert_date"] = '';
$this->model["insert_user"] = '';
$this->model['att'] = '';
}
开发者ID:yixingseo,项目名称:QingCmsPHP,代码行数:21,代码来源:news.class.php
注:本文中的guid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论