當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reminder::addCustomerAssociation方法代碼示例

本文整理匯總了PHP中Reminder::addCustomerAssociation方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reminder::addCustomerAssociation方法的具體用法?PHP Reminder::addCustomerAssociation怎麽用?PHP Reminder::addCustomerAssociation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Reminder的用法示例。


在下文中一共展示了Reminder::addCustomerAssociation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

 /**
  * Method used to update the details of a specific reminder.
  *
  * @access  public
  * @return  integer 1 if the update worked, -1 or -2 otherwise
  */
 function update()
 {
     global $HTTP_POST_VARS;
     $stmt = "UPDATE\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_level\n                 SET\n                    rem_last_updated_date='" . Date_API::getCurrentDateGMT() . "',\n                    rem_rank=" . Misc::escapeInteger($HTTP_POST_VARS['rank']) . ",\n                    rem_title='" . Misc::escapeString($HTTP_POST_VARS['title']) . "',\n                    rem_prj_id=" . Misc::escapeInteger($HTTP_POST_VARS['project']) . ",\n                    rem_skip_weekend=" . Misc::escapeInteger($HTTP_POST_VARS['skip_weekend']) . "\n                 WHERE\n                    rem_id=" . Misc::escapeInteger($HTTP_POST_VARS['id']);
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         Reminder::removeAllAssociations($HTTP_POST_VARS['id']);
         // map the reminder requirements now
         if (@$HTTP_POST_VARS['reminder_type'] == 'support_level' && count($HTTP_POST_VARS['support_levels']) > 0) {
             for ($i = 0; $i < count($HTTP_POST_VARS['support_levels']); $i++) {
                 Reminder::addSupportLevelAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['support_levels'][$i]);
             }
         } elseif (@$HTTP_POST_VARS['reminder_type'] == 'issue' && count($HTTP_POST_VARS['issues']) > 0) {
             for ($i = 0; $i < count($HTTP_POST_VARS['issues']); $i++) {
                 Reminder::addIssueAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['issues'][$i]);
             }
         } elseif (@$HTTP_POST_VARS['reminder_type'] == 'customer' && count($HTTP_POST_VARS['customers']) > 0) {
             for ($i = 0; $i < count($HTTP_POST_VARS['customers']); $i++) {
                 Reminder::addCustomerAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['customers'][$i]);
             }
         } elseif (@$HTTP_POST_VARS['reminder_type'] == 'all_issues') {
             Reminder::associateAllIssues($HTTP_POST_VARS['id']);
         }
         if (@$HTTP_POST_VARS['check_priority'] == 'yes' && count($HTTP_POST_VARS['priorities']) > 0) {
             for ($i = 0; $i < count($HTTP_POST_VARS['priorities']); $i++) {
                 Reminder::addPriorityAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['priorities'][$i]);
             }
         }
         return 1;
     }
 }
開發者ID:juliogallardo1326,項目名稱:proc,代碼行數:40,代碼來源:class.reminder.php


注:本文中的Reminder::addCustomerAssociation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。