本文整理汇总了PHP中getUuid函数的典型用法代码示例。如果您正苦于以下问题:PHP getUuid函数的具体用法?PHP getUuid怎么用?PHP getUuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUuid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: upload_img
function upload_img($file_upload_name)
{
$imgName = $_FILES["{$file_upload_name}"]['name'];
//上传文件的名称
$imgType = $_FILES["{$file_upload_name}"]['type'];
//上传文件的类型
$imgSize = $_FILES["{$file_upload_name}"]['size'];
//上传文件的大小
$imgTmp_name = $_FILES["{$file_upload_name}"]['tmp_name'];
//上传文件在服务器上的临时文件名称
//随机生成一个图片名称
$imgDbName = md5(getUuid());
//截取文件的后缀
$ext = explode(".", $imgName);
$ext = $ext[count($ext) - 1];
$savePath = "pages/upload/" . $imgDbName . "." . $ext;
if (file_exists($savePath)) {
// 如果存在这个路径
echo $savePath . "already exists<br />\n";
} else {
// 不存在路径的时候
move_uploaded_file($imgTmp_name, ykfile($savePath));
return $savePath;
}
}
开发者ID:samuel072,项目名称:PHP,代码行数:25,代码来源:talker.php
示例2: createCCR
function createCCR($action, $raw = "no", $requested_by = "")
{
$authorID = getUuid();
$patientID = getUuid();
$sourceID = getUuid();
$oemrID = getUuid();
$result = getActorData();
while ($res = sqlFetchArray($result[2])) {
${"labID{$res['id']}"} = getUuid();
}
$ccr = new DOMDocument('1.0', 'UTF-8');
$e_styleSheet = $ccr->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="stylesheet/ccr.xsl"');
$ccr->appendChild($e_styleSheet);
$e_ccr = $ccr->createElementNS('urn:astm-org:CCR', 'ContinuityOfCareRecord');
$ccr->appendChild($e_ccr);
/////////////// Header
require_once "createCCRHeader.php";
$e_Body = $ccr->createElement('Body');
$e_ccr->appendChild($e_Body);
/////////////// Problems
$e_Problems = $ccr->createElement('Problems');
require_once "createCCRProblem.php";
$e_Body->appendChild($e_Problems);
/////////////// Alerts
$e_Alerts = $ccr->createElement('Alerts');
require_once "createCCRAlerts.php";
$e_Body->appendChild($e_Alerts);
////////////////// Medication
$e_Medications = $ccr->createElement('Medications');
require_once "createCCRMedication.php";
$e_Body->appendChild($e_Medications);
///////////////// Immunization
$e_Immunizations = $ccr->createElement('Immunizations');
require_once "createCCRImmunization.php";
$e_Body->appendChild($e_Immunizations);
/////////////////// Results
$e_Results = $ccr->createElement('Results');
require_once "createCCRResult.php";
$e_Body->appendChild($e_Results);
/////////////////// Procedures
//$e_Procedures = $ccr->createElement('Procedures');
//require_once("createCCRProcedure.php");
//$e_Body->appendChild($e_Procedures);
//////////////////// Footer
// $e_VitalSigns = $ccr->createElement('VitalSigns');
// $e_Body->appendChild($e_VitalSigns);
/////////////// Actors
$e_Actors = $ccr->createElement('Actors');
require_once "createCCRActor.php";
$e_ccr->appendChild($e_Actors);
if ($action == "generate") {
gnrtCCR($ccr, $raw, $requested_by);
}
if ($action == "viewccd") {
viewCCD($ccr, $raw, $requested_by);
}
}
开发者ID:katopenzz,项目名称:openemr,代码行数:57,代码来源:createCCR.php
示例3: advancedSort
function advancedSort($db, $tabledefid)
{
$this->db = $db;
$this->tabledefid = $tabledefid;
$this->tabledefuuid = getUuid($this->db, "tbld:5c9d645f-26ab-5003-b98e-89e9049f8ac3", (int) $tabledefid);
$querystatement = "\n SELECT\n `prefix`\n FROM\n `tabledefs`\n WHERE\n `uuid` = '" . $this->tabledefuuid . "'\n ";
$queryresult = $this->db->query($querystatement);
$therecord = $this->db->fetchArray($queryresult);
$this->prefix = $therecord["prefix"];
}
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:10,代码来源:advancedsort.php
示例4: createCCR
function createCCR($action, $raw = "no")
{
$authorID = getUuid();
echo '<!--';
$ccr = new DOMDocument('1.0', 'UTF-8');
$e_styleSheet = $ccr->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="ccr.xsl"');
$ccr->appendChild($e_styleSheet);
$e_ccr = $ccr->createElementNS('urn:astm-org:CCR', 'ContinuityOfCareRecord');
$ccr->appendChild($e_ccr);
/////////////// Header
require_once "createCCRHeader.php";
$e_Body = $ccr->createElement('Body');
$e_ccr->appendChild($e_Body);
/////////////// Problems
$e_Problems = $ccr->createElement('Problems');
require_once "createCCRProblem.php";
$e_Body->appendChild($e_Problems);
/////////////// Alerts
$e_Alerts = $ccr->createElement('Alerts');
require_once "createCCRAlerts.php";
$e_Body->appendChild($e_Alerts);
////////////////// Medication
$e_Medications = $ccr->createElement('Medications');
require_once "createCCRMedication.php";
$e_Body->appendChild($e_Medications);
///////////////// Immunization
$e_Immunizations = $ccr->createElement('Immunizations');
require_once "createCCRImmunization.php";
$e_Body->appendChild($e_Immunizations);
/////////////////// Results
$e_Results = $ccr->createElement('Results');
require_once "createCCRResult.php";
$e_Body->appendChild($e_Results);
/////////////////// Procedures
$e_Procedures = $ccr->createElement('Procedures');
require_once "createCCRProcedure.php";
$e_Body->appendChild($e_Procedures);
//////////////////// Footer
// $e_VitalSigns = $ccr->createElement('VitalSigns');
// $e_Body->appendChild($e_VitalSigns);
/////////////// Actors
$e_Actors = $ccr->createElement('Actors');
require_once "createCCRActor.php";
$e_ccr->appendChild($e_Actors);
// save created CCR in file
echo " \n action=" . $action;
if ($action == "generate") {
gnrtCCR($ccr, $raw);
}
if ($action == "viewccd") {
viewCCD($ccr, $raw);
}
}
开发者ID:richsiy,项目名称:openemr,代码行数:53,代码来源:createCCR.php
示例5: recurringinvoice
function recurringinvoice($db, $invoiceid)
{
$this->db = $db;
$this->invoiceid = (int) $invoiceid;
$this->invoiceuuid = getUuid($this->db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883", $this->invoiceid);
$this->weekArray = array("First" => "1", "Second" => "2", "Third" => "3", "Fourth" => "4", "Last" => "5");
$this->dayOfWeekArray = array();
$this->dayOfWeekArray[nl_langinfo(constant("DAY_1"))] = 7;
for ($i = 1; $i <= 6; $i++) {
$this->dayOfWeekArray[nl_langinfo(constant("DAY_" . ($i + 1)))] = $i;
}
}
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:12,代码来源:recurringinvoices.php
示例6: copyRecordToTmp
public function copyRecordToTmp($recno, $new_record = FALSE)
{
setMickaLog("Copy record recno={$recno} to TMP", 'DEBUG', 'MdRecord.copyRecordToTmp');
$rs = array();
$rs['ok'] = FALSE;
$rs['recno_tmp'] = -1;
$rs['report'] = '';
if ($recno == '' || $recno < 1) {
setMickaLog("Record not exist", 'ERROR', 'MdRecord.copyRecordToTmp');
$rs['report'] = 'Record not exist';
return $rs;
}
$this->setTableMode('md');
$md = $this->getMd('recno', $recno);
if ($md['report'] != 'ok' || $this->md_record['md']['RECNO'] != $recno) {
setMickaLog($md['report'], 'ERROR', 'MdRecord.copyRecordToTmp');
$rs['report'] = $md['report'];
return $rs;
}
if ($this->md_record['user_right'] == 'r') {
setMickaLog("Not edit rights", 'ERROR', 'MdRecord.copyRecordToTmp');
$rs['report'] = 'Not edit rights';
return $rs;
}
$mds = isset($md['md']['MD_STANDARD']) ? $md['md']['MD_STANDARD'] : '';
$this->deleteTmpRecords();
$sql = array();
$recno_tmp = $this->getNewRecno($this->table_md);
$sid = $this->sid;
$tmp_table_md = TMPTABLE_PREFIX . '_md';
$tmp_table_md_values = TMPTABLE_PREFIX . '_md_values';
if ($new_record === TRUE) {
// nový záznam kopií stávajícího
$uuid = getUuid();
$create_user = $this->user;
$create_date = DB_DRIVER == 'mssql2005' ? str_replace('-', '', getNewDate()) : getNewDate();
$edit_group = $this->defaultValueMd['edit_group'];
$view_group = $this->defaultValueMd['view_group'];
array_push($sql, "\n\t\t\t\tINSERT INTO {$tmp_table_md} (sid,recno,uuid,md_standard,lang,data_type,create_user,create_date,edit_group,view_group,x1,y1,x2,y2,the_geom,range_begin,range_end,md_update,title,server_name,pxml,valid)\n\t\t\t\tSELECT %s,%i,'{$uuid}',md_standard,lang,0,'{$create_user}','{$create_date}','{$edit_group}','{$view_group}',x1,y1,x2,y2,the_geom,range_begin,range_end,md_update,title,server_name,pxml,valid\n\t\t\t\tFROM md WHERE recno=%i\n\t\t\t", $this->sid, $recno_tmp, $recno);
} else {
array_push($sql, "\n\t\t\t\tINSERT INTO {$tmp_table_md} (sid,recno,uuid,md_standard,lang,data_type,create_user,create_date,edit_group,view_group,x1,y1,x2,y2,the_geom,range_begin,range_end,md_update,title,server_name,xmldata,pxml,valid)\n\t\t\t\tSELECT %s,%i,uuid,md_standard,lang,data_type,create_user,create_date,edit_group,view_group,x1,y1,x2,y2,the_geom,range_begin,range_end,md_update,title,server_name,xmldata,pxml,valid\n\t\t\t\tFROM md WHERE recno=%i\n\t\t\t", $this->sid, $recno_tmp, $recno);
}
$result = _executeSql('insert', $sql, array('all'));
$sql = array();
array_push($sql, "\n\t\t\tINSERT INTO {$tmp_table_md_values} (recno, md_id, md_value, md_path, lang , package_id)\n\t\t\tSELECT %i, md_id, md_value, md_path, lang , package_id FROM md_values WHERE recno=%i\n\t\t", $recno_tmp, $recno);
$result = _executeSql('insert', $sql, array('all'));
if ($new_record) {
// nové uuid do md_values
if ($mds == 0 || $mds == 10) {
$sql = array();
array_push($sql, "DELETE FROM {$tmp_table_md_values} WHERE recno=%i AND md_id=38", $recno_tmp);
$result = _executeSql('delete', $sql, array('all'));
$this->setTableMode('tmp');
$this->getMd('recno', $recno_tmp);
$this->setMdValuesFileIdentifier($recno_tmp, $mds, $uuid);
}
}
$rs['recno_tmp'] = $recno_tmp;
$rs['report'] = 'ok';
$rs['ok'] = TRUE;
return $rs;
}
开发者ID:riskatlas,项目名称:micka,代码行数:62,代码来源:MdRecord.php
示例7: array
$xml->open_customTag('reference', $arr);
//externalObservation Start
$arr = array('classCode' => 'OBS', 'moodCode' => 'EVN');
$xml->open_customTag('externalObservation', $arr);
//Modified HQMF_ID for CQM IDS
if ($row['cqm_nqf_code'] == "0421") {
$refID = $preDefPopIdArr[$row['cqm_nqf_code']][$row['numerator_label']][$mainQrdaPopulationIncArr[$cqmKey]];
} else {
if ($row['cqm_nqf_code'] == "0024") {
$refID = $preDefPopIdArr[$row['cqm_nqf_code']][$row['population_label']][$row['numerator_label']][$mainQrdaPopulationIncArr[$cqmKey]];
} else {
$refID = $preDefPopIdArr[$row['cqm_nqf_code']][$mainQrdaPopulationIncArr[$cqmKey]];
}
}
if ($refID == "") {
$refID = getUuid();
}
$xml->self_customId($refID);
//externalObservation Close
$xml->close_customTag();
//reference Close
$xml->close_customTag();
########################################################################
//observation Close
$xml->close_customTag();
$xml->close_loopComponent();
############### Initial patient population template END#####################
}
//Multiple Numerator Handling
if (in_array($row['cqm_nqf_code'], $multNumNQFArr)) {
//Skipping Multiple Numerator(s)
开发者ID:mi-squared,项目名称:openemr,代码行数:31,代码来源:export_qrda_xml.php
示例8: isset
require_once 'common/config/conf.php';
require_once 'common/functions.php';
isset($_POST['username']) ? $username = $_POST['username'] : ($username = null);
isset($_POST['passwd']) ? $passwd = $_POST['passwd'] : ($passwd = null);
//检查用户名
function check_username()
{
$dbh = mysql::getInstance();
$username = $dbh->select('blog_users', ['username' => $_GET['username']]);
if ($username) {
//该用户已存在
echo 201;
} else {
//该用户不存在
echo 404;
}
}
if (isset($_GET['username']) ? $_GET['username'] : false) {
check_username();
}
//用户注册
//TODO: 注册后的操作
if ($username != null && $passwd != null) {
$dbh = mysql::getInstance();
if ($dbh->insert('blog_users', ['id' => getUuid(), 'username' => $username, 'passwd' => $passwd])) {
setcookie('username', $username, COOKIE_EXPIRE);
header("location:http://localhost:8080/blog/index.php");
} else {
echo 'it false';
}
}
开发者ID:ztaoge,项目名称:blog,代码行数:31,代码来源:signup.php
示例9: zeroPath
a<?php
require_once zeroPath('Mysql.class.php');
$uuid = getUuid();
$sql = "insert into zp_user (uuid, user_name, password, sex, age, avatar, time, login_ip) values ('" . $uuid . "', 'zero', '" . md5('111111') . "', 1, 25, 'http://pics.sc.chinaz.com/files/pic/pic9/201511/apic16807.jpg', '" . date('Y:m:d h:i:s', time()) . "', '" . getIp() . "')";
$result = $db->adu($sql);
开发者ID:samuel072,项目名称:PHP,代码行数:5,代码来源:UserController.php
示例10: patCharactersticQRDA
function patCharactersticQRDA($xml, $patient_id)
{
//Patient History
$patHist = patientQRDAHistory($patient_id);
//Entry open
$xml->open_entry();
//observation Open
$xml->open_customTag('observation', array('classCode' => 'OBS', 'moodCode' => 'EVN'));
$tempID = "2.16.840.1.113883.10.20.22.4.85";
$xml->self_templateid($tempID);
$actId = getUuid();
$xml->self_customId($actId);
$arr = array('code' => 'ASSERTION', 'displayName' => 'Assertion', 'codeSystem' => '2.16.840.1.113883.5.4', 'codeSystemName' => 'ActCode');
$xml->self_codeCustom($arr);
$arr = array('code' => 'completed');
$xml->self_customTag('statusCode', $arr);
$timeArr = array('low' => date('Ymdhis', strtotime($patHist['date'])), 'high' => date('Ymdhis', strtotime($patHist['date'])));
$xml->add_entryEffectTime($timeArr);
$xml->self_customTag('value', array('xsi:type' => 'CD', 'code' => '160603005', 'codeSystem' => '2.16.840.1.113883.6.96'));
//observation Close
$xml->close_customTag();
//Entry close
$xml->close_entry();
}
开发者ID:katopenzz,项目名称:openemr,代码行数:24,代码来源:qrda_category1_functions.php
示例11: prepareVariables
//.........这里部分代码省略.........
if (strpos($thename, ",") != false) {
$thename = strrev(preg_replace("/,/", "dna ", strrev($thename), 1));
}
$variables["repeateachlist"] = $variables["eachlist"];
$variables["repeatontheday"] = NULL;
$variables["repeatontheweek"] = NULL;
} else {
foreach ($this->weekArray as $key => $value) {
if ($value == $variables["monthlyontheweek"]) {
$thename .= " " . strtolower($key);
}
}
foreach ($this->dayOfWeekArray as $key => $value) {
if ($value == $variables["monthlyontheday"]) {
$thename .= " " . $key;
}
}
$variables["repeateachlist"] = NULL;
$variables["repeatontheday"] = $variables["monthlyontheday"];
$variables["repeatontheweek"] = $variables["monthlyontheweek"];
}
break;
case "Yearly":
if ($variables["repeatevery"] > 1) {
$thename .= $variables["repeatevery"] . " years";
} else {
$thename .= "year";
}
$thename .= " in";
foreach (explode("::", $variables["eachlist"]) as $monthNum) {
$thename .= " " . nl_langinfo(constant("MON_" . $monthNum)) . ", ";
}
$thename = substr($thename, 0, strlen($thename) - 2);
if (strpos($thename, ",") != false) {
$thename = strrev(preg_replace("/,/", "dna ", strrev($thename), 1));
}
$variables["repeateachlist"] = $variables["eachlist"];
if (isset($variables["yearlyOnThe"])) {
$thename .= " on the";
foreach ($this->weekArray as $key => $value) {
if ($value == $variables["yearlyontheweek"]) {
$thename .= " " . strtolower($key);
}
}
foreach ($this->dayOfWeekArray as $key => $value) {
if ($value == $variables["yearlyontheday"]) {
$thename .= " " . $key;
}
}
$variables["repeatontheday"] = $variables["yearlyontheday"];
$variables["repeatontheweek"] = $variables["yearlyontheweek"];
} else {
$variables["repeatontheday"] = NULL;
$variables["repeatontheweek"] = NULL;
}
//end if
break;
}
switch ($variables["repeatend"]) {
case "never":
$variables["repeatuntil"] = NULL;
$variables["repeattimes"] = NULL;
break;
case "after":
$thename .= " for " . $variables["repeattimes"];
$variables["repeatuntil"] = NULL;
break;
case "on date":
$thename .= " until " . $variables["repeatuntil"];
$variables["repeattimes"] = NULL;
break;
}
$thename = trim($thename) . ".";
$variables["repeatname"] = $thename;
$variables["firstrepeat"] = dateToString(stringToDate($variables["firstrepeat"], "SQL"));
$variables["lastrepeat"] = dateToString(stringToDate($variables["lastrepeat"], "SQL"));
$variables["timesrepeated"] = NULL;
} else {
$variables["repeat"] = 0;
$variables["repeatechlist"] = NULL;
$variables["repeatontheday"] = NULL;
$variables["repeatontheweek"] = NULL;
$variables["repeatname"] = NULL;
$variables["repeatuntil"] = NULL;
$variables["repeattimes"] = NULL;
$variables["firstrepeat"] = NULL;
$variables["lastrepeat"] = NULL;
$variables["timesrepeated"] = NULL;
}
//endif repeat
if ($variables["assignedtoid"] != $variables["assignedtochange"]) {
if ($variables["assignedtoid"] != "") {
$variables["assignedbyid"] = getUuid($this->db, "tbld:afe6d297-b484-4f0b-57d4-1c39412e9dfb", $userid);
} else {
$variables["assignedbyid"] = '';
}
}
//endif
return $variables;
}
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:101,代码来源:notes.php
示例12: getUuid
$e_Gender->appendChild($e_Code);
$e_Value = $ccr->createElement('Value');
$e_Code->appendChild($e_Value);
$e_IDs = $ccr->createElement('IDs');
$e_Actor->appendChild($e_IDs);
$e_Type = $ccr->createElement('Type');
$e_IDs->appendChild($e_Type);
$e_Text = $ccr->createElement('Text', 'Patient ID');
$e_Type->appendChild($e_Text);
$e_ID = $ccr->createElement('ID', $row['pid']);
$e_IDs->appendChild($e_ID);
$e_Source = $ccr->createElement('Source');
$e_IDs->appendChild($e_Source);
$e_SourceActor = $ccr->createElement('Actor');
$e_Source->appendChild($e_SourceActor);
$e_ActorID = $ccr->createElement('ActorID', getUuid());
$e_SourceActor->appendChild($e_ActorID);
// address
$e_Address = $ccr->createElement('Address');
$e_Actor->appendChild($e_Address);
$e_Type = $ccr->createElement('Type');
$e_Address->appendChild($e_Type);
$e_Text = $ccr->createElement('Text', 'H');
$e_Type->appendChild($e_Text);
$e_Line1 = $ccr->createElement('Line1', $row['street']);
$e_Address->appendChild($e_Line1);
$e_Line2 = $ccr->createElement('Line2');
$e_Address->appendChild($e_Line1);
$e_City = $ccr->createElement('City', $row['city']);
$e_Address->appendChild($e_City);
$e_State = $ccr->createElement('State', $row['state']);
开发者ID:juggernautsei,项目名称:openemr,代码行数:31,代码来源:createCCRActor.php
示例13: getUuid
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Garden State Health Systems <http://www.gshsys.com/>
* @link http://www.open-emr.org
*/
global $pid;
$e_ccrDocObjID = $ccr->createElement('CCRDocumentObjectID', getUuid());
$e_ccr->appendChild($e_ccrDocObjID);
$e_Language = $ccr->createElement('Language');
$e_ccr->appendChild($e_Language);
$e_Text = $ccr->createElement('Text', 'English');
$e_Language->appendChild($e_Text);
$e_Version = $ccr->createElement('Version', 'V1.0');
$e_ccr->appendChild($e_Version);
$e_dateTime = $ccr->createElement('DateTime');
$e_ccr->appendChild($e_dateTime);
$e_ExactDateTime = $ccr->createElement('ExactDateTime', date('Y-m-d\\TH:i:s\\Z'));
$e_dateTime->appendChild($e_ExactDateTime);
$e_patient = $ccr->createElement('Patient');
$e_ccr->appendChild($e_patient);
//$e_ActorID = $ccr->createElement('ActorID', $row['patient_id']);
$e_ActorID = $ccr->createElement('ActorID', 'A1234');
开发者ID:katopenzz,项目名称:openemr,代码行数:31,代码来源:createCCRHeader.php
示例14: importRecords
function importRecords($rows, $titles)
{
switch ($this->importType) {
case "sugarcrm":
$thereturn = $this->_formatSugarVariables($rows, $titles);
$rows = $thereturn["rows"];
$titles = $thereturn["titles"];
case "csv":
//count total fieldnames (top row of csv document)
$fieldNum = count($titles);
//the file starts at line number 1, but since line 1 is
//supposed to be the fieldnames in the table(s), the lines
//being insereted start @ 2.
$rowNum = 2;
//get the data one row at a time
foreach ($rows as $rowData) {
$theid = 0;
// set for when verifification does not pass
$verify = array();
//set for when number of field rows does not match number of titles
//trim off leading/trailing spaces
$trimmedRowData = array();
foreach ($rowData as $name => $data) {
$trimmedRowData[$name] = trim($data);
}
//check to see if number of fieldnames is consistent for each row
$rowFieldNum = count($trimmedRowData);
//if valid, insert, if not, log error and don't insert.
if ($rowFieldNum == $fieldNum) {
$verify = $this->table->verifyVariables($trimmedRowData);
if (!count($verify)) {
$createdby = NULL;
$overrideID = true;
$replace = false;
if (!isset($trimmedRowData["uuid"])) {
$useUuid = true;
$thereturn = $this->table->insertRecord($trimmedRowData, $createdby, $overrideID, $replace, $useUuid);
$theid = $thereturn["id"];
} else {
$useUuid = false;
$thereturn = $this->table->insertRecord($trimmedRowData, $createdby, $overrideID, $replace, $useUuid);
$theid = $thereturn;
}
//end if
}
//end if
} else {
$this->error .= '<li> incorrect amount of fields for line number ' . $rowNum . '.</li>';
}
if ($theid) {
//keep track of the ids in the transaction to be able to select them
//for preview purposes
$this->transactionIDs[] = $theid;
//get first id to correct auto increment
if (!$this->revertID) {
$this->revertID = $theid;
}
$theuuid = getUuid($this->table->db, "tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083", (int) $theid);
//If it is a sugarcrm import, insert the shipping address as well
$addressVerify = array();
if ($this->importType == "sugarcrm") {
$variables = array();
if ($trimmedRowData["shipaddress1"]) {
$variables["address1"] = $trimmedRowData["shipaddress1"];
}
if ($trimmedRowData["shipcity"]) {
$variables["city"] = $trimmedRowData["shipcity"];
}
if ($trimmedRowData["shipstate"]) {
$variables["state"] = $trimmedRowData["shipstate"];
}
if ($trimmedRowData["shipcountry"]) {
$variables["country"] = $trimmedRowData["shipcountry"];
}
//check to see if there is a shipping address
if (count($variables)) {
//If there is a shipping address, we need to make any others'
//`defaultshipto` to 0
$querystatement = "\n\t\t\t\t\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\t\t\t\t\t`addresstorecord`\n\t\t\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\t\t\t`addresstorecord`.`defaultshipto` = '0'\n\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t`addresstorecord`.`recordid` = '" . mysql_real_escape_string($theuuid) . "'\n\t\t\t\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t\t\t`addresstorecord`.`tabledefid` = 'tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083';\n\t\t\t\t\t\t\t\t\t\t";
$this->table->db->query($querystatement);
$variables["title"] = "Main Shipping Address";
$variables["tabledefid"] = "tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083";
$variables["recordid"] = $theuuid;
$variables["defaultshipto"] = 1;
$variables["primary"] = 0;
$variables["existingaddressid"] = false;
$variables["uuid"] = uuid($this->table->address->prefix);
$addressVerify = $this->table->address->verifyVariables($variables);
//verify address
if (!count($addressVerify)) {
//check for errors
$this->table->address->insertRecord($variables);
}
//insert if no errors
}
//end if
}
//end if
} else {
$this->error .= '<li> failed insert for line number ' . $rowNum . '.</li>';
//.........这里部分代码省略.........
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:101,代码来源:clients.php
示例15: insertRecord
function insertRecord($variables, $createdby = NULL, $overrideID = false, $replace = false, $useUuid = false)
{
if ($createdby === NULL) {
$createdby = $_SESSION["userinfo"]["id"];
}
$newid = parent::insertRecord($variables, $createdby, $overrideID, $replace, $useUuid);
$id = $newid;
if (isset($newid["uuid"])) {
$id = $newid["id"];
}
if (ENCRYPT_PAYMENT_FIELDS && (isset($variables["ccnumber"]) || isset($variables["ccexpiration"]) || isset($variables["ccverification"]) || isset($variables["accountnumber"]) || isset($variables["routingnumber"]))) {
if ($useUuid) {
$whereclause = "`uuid` = '" . $newid["uuid"] . "'";
} else {
$whereclause = "`id` = '" . $newid . "'";
}
$querystatement = "\n\t\t\t\t\tUPDATE\n\t\t\t\t\t\t`invoices`\n\t\t\t\t\tSET ";
$fieldlist = "";
if (isset($variables["ccnumber"])) {
$variables["ccnumber"] = mysql_real_escape_string($variables["ccnumber"]);
$fieldlist .= ", `ccnumber` = " . $this->db->encrypt("'" . $variables["ccnumber"] . "'");
}
//end if
if (isset($variables["ccexpiration"])) {
$variables["ccexpiration"] = mysql_real_escape_string($variables["ccexpiration"]);
$fieldlist .= ", `ccexpiration` = " . $this->db->encrypt("'" . $variables["ccexpiration"] . "'");
}
//end if
if (isset($variables["ccverification"])) {
$variables["ccverification"] = mysql_real_escape_string($variables["ccverification"]);
$fieldlist .= ", `ccverification` = " . $this->db->encrypt("'" . $variables["ccverification"] . "'");
}
//end if
if (isset($variables["accountnumber"])) {
$variables["accountnumber"] = mysql_real_escape_string($variables["accountnumber"]);
$fieldlist .= ", `accountnumber` = " . $this->db->encrypt("'" . $variables["accountnumber"] . "'");
}
//end if
if (isset($variables["routingnumber"])) {
$variables["routingnumber"] = mysql_real_escape_string($variables["routingnumber"]);
$fieldlist .= ", `routingnumber` = " . $this->db->encrypt("'" . $variables["routingnumber"] . "'");
}
//end if
$fieldlist = substr($fieldlist, 1);
$querystatement .= $fieldlist . " WHERE `type` != 'Invoice' AND `type` != 'VOID' AND " . $whereclause;
$this->db->query($querystatement);
}
//end if
if (!isset($variables["billingsaveoptions"])) {
$variables["billingsaveoptions"] = NULL;
}
if (!isset($variables["shiptosaveoptions"])) {
$variables["shiptosaveoptions"] = NULL;
}
if ($variables["billingsaveoptions"] != "orderOnly" || $variables["shiptosaveoptions"] != "orderOnly") {
require_once "addresses.php";
require_once "addresstorecord.php";
if (!isset($variables["uuid"])) {
$variables["uuid"] = getUuid($this->db, $this->uuid, $newid);
}
$newuuid = mysql_real_escape_string($variables["uuid"]);
$this->addressUpdate($variables, $newuuid, $createdby, "billing");
$this->addressUpdate($variables, $newuuid, $createdby, "shipping");
}
//end if
if (!isset($variables["lineitemschanged"])) {
$variables["lineitemschanged"] = '';
}
if ($variables["lineitemschanged"] == 1) {
if ($this->lineitems === NULL) {
$this->lineitems = new lineitems($this->db, $id);
} else {
$this->lineitems->invoiceid = $id;
}
$this->lineitems->set($variables["thelineitems"], $createdby);
}
//end if
if (!isset($variables["statusdate"])) {
$variables["statusdate"] = '';
}
if (!isset($variables["assignedtoid"])) {
$variables["assignedtoid"] = '';
}
//if($variables["statuschanged"]==1)
$this->updateStatus($id, $variables["statusid"], $variables["statusdate"], $variables["assignedtoid"], $replace);
if ($variables["clienttype"] == "prospect" && $variables["type"] == "Order") {
$this->prospectToClient($variables["clientid"]);
}
return $newid;
}
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:90,代码来源:invoices.php
示例16: getUuid
<?php
require_once 'common/config/conf.php';
require_once 'vendor/mysql.php';
//require_once 'vendor/page.php';
require_once 'common/functions.php';
$dbh = mysql::getInstance();
$value = ['id' => getUuid(), 'username' => '1zzz', 'passwd' => '1zzz', 'email' => '[email protected]'];
//$dbh->insert('blog_users', $value);
//var_dump($dbh->select('blog_users'));
//$dbh->insert('c',['id'=>11]);
$list = $dbh->select('blog_users', [], [0, 1], 'id', 'desc');
//print_r($list);
//var_dump($value);
$data = [];
//$data['id'] = 11;
//$data['author_id'] = 11;
//$data['post_content'] = 'asdfa';
//if ($dbh->insert('blog_posts', $data)) {
// echo 'it work';
//} else {
// echo 'failure';
//}
//$data['id'] = getUuid();
//$data['post_author_id'] = 11;
//$data['post_title'] = 'asdfasf';
//$data['post_content'] = '<p>wfasdf</p>';
//$dbh->insert('blog_posts', $data);
//var_dump($data);
header('charset=utf8');
$posts = $dbh->select('blog_posts', ['id' => $post_id = 145786642660151]);
开发者ID:ztaoge,项目名称:blog,代码行数:31,代码来源:test.php
示例17: showLoad
/**
* displays the load box for saved searches
*
* @param integer $tabledefid id of tabledef
* @param string $userid uuid of user
* @param string $securitywhere additional security based where clause to pass
*/
function showLoad($tabledefid, $userid, $securitywhere)
{
$uuid = getUuid($this->db, "tbld:5c9d645f-26ab-5003-b98e-89e9049f8ac3", $tabledefid);
$querystatement = "\n SELECT\n id,\n name,\n userid\n FROM\n usersearches\n WHERE\n tabledefid = '" . $uuid . "'\n AND type='SCH'\n AND (\n (userid = '' " . $securitywhere . ")\n OR userid = '" . $userid . "')\n ORDER BY\n userid,\n name";
$queryresult = $this->db->query($querystatement);
if (!$queryresult) {
$error = new appError(500, "Cannot retrieve saved search information");
}
$querystatement = "\n SELECT\n advsearchroleid\n FROM\n tabledefs\n WHERE id= '" . $tabledefid . "'";
$tabledefresult = $this->db->query($querystatement);
if (!$tabledefresult) {
$error = new appError(500, "Cannot retrieve table definition information.");
}
$tableinfo = $this->db->fetchArray($tabledefresult);
?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<p>
<label for="LSList">saved searches</label><br />
<?php
$this->showSavedSearchList($queryresult);
?>
</p>
</td>
<td valign="top" width="100%">
<p>
<label for="LSSelectedSearch">name</label><br />
<input type="text" id="LSSelectedSearch" size="10" readonly="readonly" class="uneditable" />
</p>
<p>
<textarea id="LSSQL" name="LSSQL" rows="8" cols="10" <?php
if (!hasRights($tableinfo["advsearchroleid"])) {
echo ' readonly="readonly"';
}
?>
></textarea>
</p>
</td>
<td valign="top">
<p><br/><input id="LSLoad" type="submit" name="command" class="Buttons" disabled="disabled" value="run search"/></p>
<p><input id="LSDelete" type="button" onclick="LSDeleteSearch('<?php
echo APP_PATH;
?>
')" class="Buttons" disabled="disabled" value="delete"/></p>
<div id="LSResults"> </div>
</td>
</tr>
</table>
<?php
}
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:58,代码来源:loadsearch.php
|
请发表评论