本文整理汇总了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;
}