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


PHP notification::addNotification方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:kamalthakker,项目名称:Skills_Endorsement_Project,代码行数:28,代码来源:endorsement.php

示例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;
 }
开发者ID:kamalthakker,项目名称:Skills_Endorsement_Project,代码行数:16,代码来源:project.php


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