当前位置: 首页>>代码示例>>PHP>>正文


PHP newGuid函数代码示例

本文整理汇总了PHP中newGuid函数的典型用法代码示例。如果您正苦于以下问题:PHP newGuid函数的具体用法?PHP newGuid怎么用?PHP newGuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了newGuid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_child

 function add_child($parent, $label, $text)
 {
     global $db;
     try {
         $insertQuery = $db->prepare("INSERT INTO agentLogins (parent, label, value, guid) VALUES (:parent, :label, :text, :guid)");
         $insertQuery->execute(array(':parent' => $parent, ':label' => $label, ':text' => $text, ':guid' => newGuid()));
     } catch (PDOException $e) {
         exit("error in query");
     }
 }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:10,代码来源:agentLogins.php

示例2: setNotes

 function setNotes($employee, $semester, $requested, $registered, $notes)
 {
     global $db;
     try {
         $insertQuery = $db->prepare("INSERT INTO scheduleNotes (netID, semester, requestedHours, registeredHours, notes, guid) VALUES (:employee,:semester,:requested,:registered,:notes,:guid) ON DUPLICATE KEY UPDATE requestedHours=:requested1,registeredHours=:registered1,notes=:notes1");
         $success = $insertQuery->execute(array(':employee' => $employee, ':semester' => $semester, ':requested' => $requested, ':registered' => $registered, ':notes' => addSlashes($notes), ':guid' => newGuid(), ':requested1' => $requested, ':registered1' => $registered, ':notes1' => addSlashes($notes)));
     } catch (PDOException $e) {
         exit("error in query");
     }
     echo $success;
 }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:11,代码来源:periodNotes.php

示例3: createLevel

/**
 * Creates a new level in the database
 */
function createLevel($data)
{
    global $db;
    try {
        $highestLevelQuery = $db->prepare("SELECT level FROM employeeRightsLevels WHERE area = :area ORDER BY level DESC LIMIT 1");
        $highestLevelQuery->execute(array(':area' => $data['area']));
    } catch (PDOException $e) {
        exit("error in query");
    }
    $result = $highestLevelQuery->fetch();
    $highestLevel = $result->level;
    try {
        $insertQuery = $db->prepare("INSERT INTO employeeRightsLevels (name,level,area,guid) VALUES ('',:highestLevel,:area,:guid)");
        $insertQuery->execute(array(':highestLevel' => $highestLevel + 1, ':area' => $data['area'], ':guid' => newGuid()));
    } catch (PDOException $e) {
        exit("error in query");
    }
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:21,代码来源:index.php

示例4: newGuid

     }
     // If this is our first entry do not add a coma in front of our values, otherwise add it
     if (strtotime($instanceStart) >= strtotime('+7 days', strtotime($periodStart))) {
         $instanceQueryString .= ', ';
     }
     $instanceQueryString .= " (:employee" . $i . ",:startTime" . $i . ",:start" . $i . ",:endTime" . $i . ",:end" . $i . ",:type" . $i . ",:total" . $i . ",:default" . $i . ",:area" . $i . ",:guid" . $i . ") ";
     $instanceQueryParams[':employee' . $i] = $employee;
     $instanceQueryParams[':startTime' . $i] = $startTime;
     $instanceQueryParams[':start' . $i] = $instanceStart;
     $instanceQueryParams[':endTime' . $i] = $endTime;
     $instanceQueryParams[':end' . $i] = $instanceEnd;
     $instanceQueryParams[':type' . $i] = $hourType;
     $instanceQueryParams[':total' . $i] = $hourTotal;
     $instanceQueryParams[':default' . $i] = $defaultId;
     $instanceQueryParams[':area' . $i] = $area;
     $instanceQueryParams[':guid' . $i] = newGuid();
     $i++;
     $instanceStart = date('Y-m-d H:i:00', strtotime('+7 days', strtotime($instanceStart)));
     $instanceEnd = date('Y-m-d H:i:00', strtotime('+7 days', strtotime($instanceEnd)));
     $executeCheck = true;
 }
 if ($executeCheck) {
     try {
         $instanceInsertQuery = $db->prepare($instanceQueryString);
         $instanceInsertQuery->execute($instanceQueryParams);
     } catch (PDOException $e) {
         $db->rollBack();
         exit("error in query");
     }
 }
 $db->commit();
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:31,代码来源:newDefaultShift.php

示例5: catch

             $groupid = $userar;
         } else {
             $groupid = $userorg;
         }
     }
     try {
         $contactPriorityQuery = $db->prepare("SELECT * FROM contacts WHERE department=:group ORDER BY contactPriority DESC LIMIT 1");
         $contactPriorityQuery->execute(array(':group' => $groupid));
     } catch (PDOException $e) {
         exit("error in query");
     }
     $addContactPriority = $contactPriorityQuery->fetch(PDO::FETCH_ASSOC);
     $userpriority = $addContactPriority['contactPriority'] + 1;
     try {
         $addContactQuery = $db->prepare("INSERT INTO contacts (name, phone, address, position, contactPriority, managerFlag, department, guid) VALUES (:user, :phone, :address, :position, :priority, :manager, :group, :guid)");
         $addContactQuery->execute(array(':user' => $username, ':phone' => $userphone, ':address' => $useraddress, ':position' => $userposition, ':priority' => $userpriority, ':manager' => $usermanagerFlag, ':group' => $groupid, ':guid' => newGuid()));
     } catch (PDOException $e) {
         exit("error in query");
     }
 }
 if ($edit_contact != "") {
     try {
         $infoQuery = $db->prepare("SELECT department FROM contacts WHERE id=:id");
         $infoQuery->execute(array(':id' => $userid));
     } catch (PDOException $e) {
         exit("error in query");
     }
     $oldinfo = $infoQuery->fetch(PDO::FETCH_ASSOC);
     if ($oldinfo['department'] != $userdept) {
         try {
             $maxPriorityQuery = $db->prepare("SELECT * FROM contacts WHERE department=:dept ORDER BY contactPriority DESC");
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:31,代码来源:contactsEdit.php

示例6: createRightStatus

/**
 * Creates a status for the employee and the right in the database
 *
 * @param $right    The id of the right whose status is being created
 * @param $employee The employee's netID
 * @param $manager  The manager's netID
 * @param $type     The right's type ('EMAIL', 'BASIC')
 */
function createRightStatus($right, $employee, $manager, $type)
{
    global $db;
    $date = date('Y-m-d');
    if ($type == "EMAIL") {
        try {
            $insertQuery = $db->prepare("INSERT INTO employeeRightsStatus (netID,rightID,rightStatus,requestedBy,requestedDate,guid) VALUES (:employee,:right,'1',:manager,:day,:guid) ON DUPLICATE KEY UPDATE requestedBy=:manager1,requestedDate=:day1,rightStatus='1'");
            $insertQuery->execute(array(':employee' => $employee, ':right' => $right, ':manager' => $manager, ':day' => $date, ':guid' => newGuid(), ':manager1' => $manager, ':day1' => $date));
        } catch (PDOException $e) {
            exit("error in query");
        }
    } else {
        if ($type == "BASIC") {
            try {
                $insertQuery = $db->prepare("INSERT INTO employeeRightsStatus (netID,rightID,rightStatus,updatedBy,updatedDate,guid) VALUES (:employee,:right,'2',:manager,:day,:guid) ON DUPLICATE KEY UPDATE updatedBy=:manager1,updatedDate=:day1,rightStatus='2'");
                $insertQuery->execute(array(':employee' => $employee, ':right' => $right, ':manager' => $manager, ':day' => $date, ':guid' => newGuid(), ':manager1' => $manager, ':day1' => $date));
            } catch (PDOException $e) {
                exit("error in query");
            }
        } else {
            return;
        }
    }
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:32,代码来源:helpers.php

示例7: explode

<?php

/*	Name: submitBid.php
*	Application: Trade Request
*
*	Description: This file is called from displayTrades.php when a user checks a trade. 
*	It creates a bid for the given hour on the given trade.
*/
//Standard include file
require "../includes/includeMeBlank.php";
//Common php functions used in the Trade Request app
include "tradesFunctions.php";
if (isset($_GET['id'])) {
    //Declare variable
    $trade = explode("_", $_GET['id']);
    //This will be an array with each element being a string in the form {netID}_{tradeID}_{hour}
    try {
        //Submit trade bid
        $insertQuery = $db->prepare("INSERT INTO `scheduleTradeBids` (tradeID, employee, hour, guid) \n\t\t\t\tVALUES (:id, :employee, :hour, :guid)\n\t\t\t\tON DUPLICATE KEY UPDATE deleted = 0");
        $insertQuery->execute(array(':id' => $trade[1], ':employee' => $trade[0], ':hour' => $trade[2], ':guid' => newGuid()));
        //Update trade in scheduleTrades
        $updateQuery = $db->prepare("UPDATE `scheduleTrades` SET bids = '1' WHERE ID = :id");
        $updateQuery->execute(array(':id' => $trade[1]));
    } catch (PDOException $e) {
        exit("error in query");
    }
}
//if
echo 1;
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:29,代码来源:submitBid.php

示例8: catch

    $tasksQuery = $db->prepare("SELECT * FROM routineTasks WHERE ID=:id");
    $tasksQuery->execute(array(':id' => $_REQUEST['id']));
} catch (PDOException $e) {
    exit("error in query");
}
$task = $tasksQuery->fetch(PDO::FETCH_ASSOC);
//------------SET VARIABLES---------------------
$title = $task['title'];
$timeDue = $task['timeDue'];
$area = $task['area'];
$completed = '1';
$timeCompleted = date('G:i');
$dateCompleted = date('Y-m-d');
$completedBy = nameByNetId($netID);
//------------------------------------------------
//Query to test whether this task is in the log already ie. its been muted.
try {
    $logQuery = $db->prepare("SELECT * FROM routineTaskLog WHERE taskId =:taskId AND (dateMuted IS NOT NULL AND dateCompleted IS NULL)");
    $logQuery->execute(array(':taskId' => $taskId));
} catch (PDOException $e) {
    exit("error in query");
}
$mutedTask = $logQuery->fetch(PDO::FETCH_ASSOC);
$logID = $mutedTask['ID'];
//queries the database and then add or updates an entry to the TaskLog
try {
    $insertQuery = $db->prepare("INSERT INTO routineTaskLog (ID,title,taskId,timeDue,dateDue,area,completed,completedBy,timeCompleted,dateCompleted,comments,guid) VALUES (:id,:title,:taskId,:timeDue,:dateDue,:area,:completed,:by,:timeCompleted,:dateCompleted,:comments,:guid) ON DUPLICATE KEY UPDATE title=:title2,taskId=:taskId2,timeDue=:timeDue2,area=:area2,completed=:completed2,completedBy=:by2,timeCompleted=:timeCompleted2,dateCompleted=:dateCompleted2,comments=:comments2");
    $insertQuery->execute(array(':id' => $logID, ':title' => $title, ':taskId' => $taskId, ':timeDue' => $timeDue, ':dateDue' => $dateDue, ':area' => $area, ':completed' => $completed, ':by' => $completedBy, ':timeCompleted' => $timeCompleted, ':dateCompleted' => $dateCompleted, ':comments' => $comments, ':guid' => newGuid(), ':title2' => $title, ':taskId2' => $taskId, ':timeDue2' => $timeDue, ':area2' => $area, ':completed2' => $completed, ':by2' => $completedBy, ':timeCompleted2' => $timeCompleted, ':dateCompleted2' => $dateCompleted, ':comments2' => $comments));
} catch (PDOException $e) {
    exit("error in query");
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:31,代码来源:completeTask.php

示例9: trim

     $third = 'None to report.';
 }
 $fourth = trim($_POST['fourth']);
 if ($fourth == '') {
     $fourth = 'None to report.';
 }
 $checkList = $_POST['checkList'];
 $start = $_POST['start'];
 $end = $_POST['end'];
 $reportDate = $_POST['reportDate'];
 $employeeName = $_POST['employeeName'];
 $employeeEmail = $_POST['employeeEmail'];
 //insert them into the database.
 try {
     $insertQuery = $db->prepare("INSERT INTO supervisorReportSD (date,submitter,startTime,endTime,area,outages,problems,misc,supTasks,guid) VALUES (:reportDate,:netId,:start,:end,:area,:first,:second,:third,:fourth,:guid)");
     $insertQuery->execute(array(':reportDate' => $reportDate, ':netId' => $netID, ':start' => $start, ':end' => $end, ':area' => $area, ':first' => $first, ':second' => $second, ':third' => $third, ':fourth' => $fourth, ':guid' => newGuid()));
 } catch (PDOException $e) {
     exit("error in query");
 }
 if (isset($_POST['openingList'])) {
     echo "<br/>Opening List<br/>";
     try {
         $tasksQuery = $db->prepare("SELECT `ID`,`text` FROM supervisorReportSDTasks WHERE area= :area AND checklist = '0'");
         $tasksQuery->execute(array(':area' => $area));
     } catch (PDOException $e) {
         exit("error in query");
     }
     while ($cur = $tasksQuery->fetch(PDO::FETCH_ASSOC)) {
         if (!isset($_POST['task' . $cur['ID']])) {
             echo "<br/>Not Complete: " . $cur['text'] . "<br/>";
         }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:31,代码来源:index.php

示例10: VALUES

<?php

/*	Name: submitEntry.php
*	Application: Manager Report
*
*	Description: This php file takes the manager entry submitted on the index.php page and saves it to the DB.
*/
//Include file to include common functions used throughout the site
require '../includes/includeMeBlank.php';
//Declare variables
global $netID;
global $area;
$comment = $_POST["comment"];
$category = $_POST["category"];
//Update DB
try {
    $insertQuery = $db->prepare("INSERT INTO `managerReports` (`netID`, `comments`, `category`, `area`, `guid`) VALUES (:netId,:comment,:category,:area,:guid)");
    $success = $insertQuery->execute(array(':netId' => $netID, ':comment' => $comment, ':category' => $category, ':area' => $area, ':guid' => newGuid()));
} catch (PDOException $e) {
    exit("error in query");
}
//Return result
if ($success) {
    echo json_encode(array('status' => $success));
} else {
    echo json_encode(array('status' => $success, 'error' => "error in query"));
}
//if-else
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:28,代码来源:submitEntry.php

示例11: date

require '../includes/includeme.php';
if (isset($_POST['absence'])) {
    if ($_POST['employee'] == '' || $_POST['date'] == '' || $_POST['reason'] == '') {
        echo "<font color='red' size='3'>Oops, You missed something.</font>";
    } else {
        $flagWarning = false;
        $employee = $_POST['employee'];
        $reason = $_POST['reason'];
        $noCall = $_POST['noCall'];
        $date = $_POST['date'];
        $start = date("H:i", strtotime($_POST['start']));
        $end = date("H:i", strtotime($_POST['end']));
        try {
            $insertQuery = $db->prepare("INSERT INTO reportAbsence (employee, date, shiftStart, shiftEnd, reason, noCall,submitter,area,guid) VALUES (:employee,:day,:start,:end,:reason,:call,:netId,:area,:guid)");
            $insertQuery->execute(array(':employee' => $_POST['employee'], ':day' => $_POST['date'], ':start' => $start, ':end' => $end, ':reason' => $_POST['reason'], ':call' => $_POST['noCall'], ':netId' => $netID, ':area' => $area, ':guid' => newGuid()));
        } catch (PDOException $e) {
            exit("error in query");
        }
        $flagCheck = date("Y-m-d", strtotime(date('m') . '/01/' . date('Y') . ' 00:00:00'));
        try {
            $countQuery = $db->prepare("SELECT COUNT(ID) FROM reportAbsence WHERE employee = :employee AND date > :day");
            $countQuery->execute(array(':employee' => $_POST['employee'], ':day' => $flagCheck));
        } catch (PDOException $e) {
            exit("error in query");
        }
        $result = $countQuery->fetch(PDO::FETCH_NUM);
        $flag = $result[0];
        if ($flag >= 3) {
            $flagWarning = true;
        }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:30,代码来源:absence.php

示例12: tag

<?php

//insertType.php
//used to insert a type via ajax
require '../../includes/includeMeBlank.php';
if (can("update", "6db1ee4f-4d80-424d-a062-97dc4cc22936")) {
    try {
        $insertQuery = $db->prepare("INSERT INTO tag (area,typeName,color,`mustApprove`,guid) VALUES (:area,'','',0,:guid)");
        $insertQuery->execute(array(':area' => $area, ':guid' => newGuid()));
    } catch (PDOException $e) {
        exit("error in query");
    }
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:13,代码来源:insertType.php

示例13: newGuid

        }
        // If this is our first entry do not add a coma in front of our values, otherwise add it
        if (strtotime($instanceStart) >= strtotime('+7 days', strtotime($periodStart))) {
            $insertQueryString .= ', ';
        }
        $insertQueryString .= " (:employee" . $i . ",:startTime" . $i . ",:start" . $i . ",:endTime" . $i . ",:end" . $i . ",:type" . $i . ",:total" . $i . ",:default" . $i . ",:area" . $i . ",:guid" . $i . ") ";
        $insertQueryParams[':employee' . $i] = $employee;
        $insertQueryParams[':startTime' . $i] = $startTime;
        $insertQueryParams[':start' . $i] = $instanceStart;
        $insertQueryParams[':endTime' . $i] = $endTime;
        $insertQueryParams[':end' . $i] = $instanceEnd;
        $insertQueryParams[':type' . $i] = $hourType;
        $insertQueryParams[':total' . $i] = $hourTotal;
        $insertQueryParams[':default' . $i] = $defaultId;
        $insertQueryParams[':area' . $i] = $area;
        $insertQueryParams[':guid' . $i] = newGuid();
        $instanceStart = date('Y-m-d H:i:00', strtotime('+7 days', strtotime($instanceStart)));
        $instanceEnd = date('Y-m-d H:i:00', strtotime('+7 days', strtotime($instanceEnd)));
        $i++;
    }
    try {
        $insertQuery = $db->prepare($insertQueryString);
        $success = $insertQuery->execute($insertQueryParams);
    } catch (PDOException $e) {
        $failure = true;
        $db->rollBack();
    }
    if (!$failure) {
        $db->commit();
    }
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:31,代码来源:updateDefaultShift.php

示例14: explode

<?php

require "../../includes/includeMeBlank.php";
$year = $_GET['year'];
$posts = explode(",", $_GET['posts']);
try {
    $scheduleQuery = $db->prepare("SELECT `weekStart` FROM `schedulePosting` WHERE `area` = :area AND `weekStart` >= :year AND `weekStart` <= :year1 ORDER BY `weekStart` ASC");
    $scheduleQuery->execute(array(':area' => $area, ':year' => $year . '-01-01', ':year1' => $year . '-12-31'));
} catch (PDOException $e) {
    exit("error in query");
}
// loop through and set any that in the list, clear any that aren't
while ($row = $scheduleQuery->fetch(PDO::FETCH_ASSOC)) {
    $value = 1;
    if (!in_array($row['weekStart'], $posts)) {
        $value = 0;
    }
    try {
        $insertQuery = $db->prepare("INSERT INTO `schedulePosting` (`weekStart`,`area`,`post`,`guid`) VALUES (:start,:area,:value,:guid) ON DUPLICATE KEY UPDATE `post`=:value1");
        $insertQuery->execute(array(':start' => $row['weekStart'], ':area' => $area, ':value' => $value, ':value1' => $value, ':guid' => newGuid()));
        $updateQuery = $db->prepare("UPDATE `scheduleWeekly` SET `posted` = :value WHERE `area` = :area AND `startDate` >= :start AND `startDate` < DATE_ADD(:start1, INTERVAL 1 WEEK)");
        $updateQuery->execute(array(':value' => $value, ':area' => $area, ':start' => $row['weekStart'], ':start1' => $row['weekStart']));
    } catch (PDOException $e) {
        exit("error in query");
    }
}
echo "Success!";
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:27,代码来源:setPostings.php

示例15: grantGroupPermissionByIndex

function grantGroupPermissionByIndex($index, $groupID)
{
    global $db;
    try {
        $insertQuery = $db->prepare("INSERT INTO permissionsGroupMembers (permID,groupID,guid) VALUES (:index,:groupID,:guid)");
        $success = $insertQuery->execute(array(':index' => $index, ':groupID' => $groupID, ':guid' => newGuid()));
    } catch (PDOException $e) {
        $success = false;
    }
    return $success;
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:11,代码来源:permissionFunctions.php


注:本文中的newGuid函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。