本文整理汇总了PHP中Options::getUUIDv6方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::getUUIDv6方法的具体用法?PHP Options::getUUIDv6怎么用?PHP Options::getUUIDv6使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::getUUIDv6方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadUserPhoto
public function uploadUserPhoto($file, $params = array())
{
if (!empty($file) && strlen($params["guid"]) > 0) {
$db = new clsDBdbConnection();
$options = Options::getConsoleOptions();
$uploadTo = $options["console_users_url"];
$tmpFile = $file["file"]["tmp_name"];
$fileName = $file["file"]["name"];
$targetPath = dirname(__FILE__) . "/.." . $uploadTo;
//because dirname will be positioned in include folder
$fileExt = "." . pathinfo($fileName, PATHINFO_EXTENSION);
$targetFilename = Options::getUUIDv6() . $fileExt;
$targetFile = $targetPath . $targetFilename;
//Updating an existing image, which will replace the existing one for the new
$params["guid"] = $db->esc($params["guid"]);
$existing_photo = CCDLookUp("photo", "alm_users", "guid = '{$params["guid"]}'", $db);
$existing_photo = trim($existing_photo);
if (strlen($existing_photo) > 0) {
//Get the existing image name to re-use it and replace image on upload
$targetFilename = $existing_photo;
$targetFile = $targetPath . $targetFilename;
}
if (move_uploaded_file($tmpFile, $targetFile)) {
//File successfully uploaded
$params["image_name"] = $targetFilename;
//Saving db file reference
$this->saveCustomerImage($params);
$db->close();
return true;
} else {
$db->close();
return false;
}
/*
$log = new Logger('almlogs');
$log->pushHandler(new StreamHandler(MAIN_LOG, Logger::WARNING));
$log->addWarning($params["guid"].LOG_LINESEPARATOR);
$log->addWarning($params["title"].LOG_LINESEPARATOR);
*/
} else {
return false;
}
}
示例2: setCheckinEmailOrder
private function setCheckinEmailOrder($orderid, $userid, $venue_id)
{
if ($orderid > 0 && $userid > 0 && $venue_id > 0) {
$db = new clsDBdbConnection();
$guid = Options::getUUIDv6();
$sql = "insert into ppconsole_ticketscheckin(guid,order_id,checkin_userid,checkin_venueid,created_iduser)\n values('{$guid}',{$orderid},{$userid},{$venue_id},{$userid}) ";
$db->query($sql);
$db->close();
return true;
} else {
return false;
}
}
示例3: setEmailNotification
public function setEmailNotification($orderid, $userid)
{
if ($orderid > 0) {
$db = new clsDBdbConnection();
$guid = Options::getUUIDv6();
$orderid = (int) $orderid;
$customer_id = (int) CCDLookUp("customer_id", "orders", "id = {$orderid}", $db);
$email = CCDLookUp("email", "customers", "id = {$customer_id}", $db);
$sql = "insert into email_notifications (guid,customer_id,email,order_id,created_iduser)\n values ('{$guid}',{$customer_id},'{$email}',{$orderid},{$userid})";
$db->query($sql);
$db->next_record();
$db->close();
return true;
} else {
return false;
}
}
示例4: setPaymentTerminal
public function setPaymentTerminal($payment_type, $currency_id, $approval_number, $payment_amount, $orderid, $userid)
{
$orderid = (int) $orderid;
$result = array("status" => false, "message" => "");
if ($orderid > 0) {
$db = new clsDBdbConnection();
$currency_id = (int) $currency_id;
$order_total = (double) CCDLookUp("total", "orders", "id = {$orderid}", $db);
$payment_amount = (double) $payment_amount;
$payment_type = (int) $payment_type;
$approval_number = $db->esc($approval_number);
if ($payment_amount >= $order_total) {
if (strlen($approval_number) > 0 && $payment_type > 0) {
$guid = Options::getUUIDv6();
$amount_residual = $payment_amount - $order_total;
$total_paid = $payment_amount - $amount_residual;
$sql = "insert into ppconsole_payments(guid,currency_id,order_id,total_paid,amount_received,amount_residual,created_userid,approval_number,paymenttype_id)\n values('{$guid}',{$currency_id},{$orderid},{$total_paid},{$payment_amount},{$amount_residual},{$userid},'{$approval_number}',{$payment_type}) ";
$db->query($sql);
$db->next_record();
//Update order status after payment confirmation
$sql = "update orders set status_id = 3,modified_iduser = {$userid} where id = {$orderid}";
$db->query($sql);
$db->next_record();
$result["status"] = true;
$result["message"] = "Order has been paid successfully";
//Notify the customer and notification list that payment for the order has been approved
$this->setNotificationOrderPaid($orderid, $userid);
} else {
$result["status"] = false;
$result["message"] = "Invalid approval number or payment type";
}
} else {
$result["status"] = false;
$result["message"] = "Input amount is less than order total";
}
$db->close();
return $result;
} else {
$result["status"] = false;
$result["message"] = "Invalid order id";
return $result;
}
}