本文整理匯總了PHP中notification::addNotification方法的典型用法代碼示例。如果您正苦於以下問題:PHP notification::addNotification方法的具體用法?PHP notification::addNotification怎麽用?PHP notification::addNotification使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類notification
的用法示例。
在下文中一共展示了notification::addNotification方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addUpdateEndorsement
public function addUpdateEndorsement($skill_endorsement_id, $skill_id, $display_user_id, $logged_user_id, $message)
{
$dbc = mysqli_connect($GLOBALS['db_servername'], $GLOBALS['db_username'], $GLOBALS['db_password'], $GLOBALS['db_name']) or die("Not connected..");
if ($skill_endorsement_id <= 0) {
$q = "INSERT INTO skill_endorsements (user_id, skill_id, endorsed_by_user_id, comments)\nVALUES (" . $display_user_id . "," . $skill_id . "," . $logged_user_id . ",'" . $message . "')";
} else {
$q = "Update skill_endorsements \n\t\t\t\t\tset \n\t\t\t\t\t\tcomments='" . $message . "',\n\t\t\t\t\t\tendorsed_on=CURRENT_TIMESTAMP\n\t\t\t\t\twhere skill_endorsement_id=" . $skill_endorsement_id;
}
//echo $q . '<br>';
$r = mysqli_query($dbc, $q);
// Get $skill_endorsement_id of the insert query
if ($skill_endorsement_id <= 0) {
$skill_endorsement_id = -1;
if ($r) {
$skill_endorsement_id = mysqli_insert_id($dbc);
}
}
mysqli_close($dbc);
// close the connection
if ($r) {
// Add notification -- endorsed
$objNotification = new notification();
$result = $objNotification->addNotification(3, $display_user_id, $logged_user_id, $skill_endorsement_id);
return true;
} else {
return false;
}
}
示例2: addProject
public function addProject($user_id, $project_name, $project_desc, $start_date, $end_date, $manager_user_id, $skills)
{
$project_id = $this->insertProject($user_id, $project_name, $project_desc, $start_date, $end_date, $manager_user_id);
if ($project_id > 0) {
// Successfuly inserted project, now insert skills
$result = $this->insertProjectSkills($project_id, $skills);
} else {
$result = false;
}
if ($result == true) {
// Add notification -- project added
$objNotification = new notification();
$result = $objNotification->addNotification(1, $manager_user_id, $user_id, $project_id);
}
return $result;
}