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


PHP Contest::getName方法代碼示例

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


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

示例1: fetchForJQDT

 /** Method that fetches entrants from database for JQuery Data Table
  * @param string $column Column name of the data to be fetched
  * @param string $condition Additional condition e.g category_id > 9
  * @param string $sort column name to be used as sort parameter
  * @return JSON JSON encoded entrant details
  */
 public function fetchForJQDT($draw, $totalData, $totalFiltered, $customSql = "", $column = "*", $condition = "", $sort = "id")
 {
     $sql = "SELECT {$column} FROM " . self::$tableName . " ORDER BY {$sort}";
     if (!empty($condition)) {
         $sql = "SELECT {$column} FROM " . self::$tableName . " WHERE {$condition} ORDER BY {$sort}";
     }
     if ($customSql != "") {
         $sql = $customSql;
     }
     $data = self::$dbObj->fetchAssoc($sql);
     $result = array();
     if (count($data) > 0) {
         foreach ($data as $r) {
             $actionButtons = '<div style="white-space:nowrap"> <button data-id="' . $r['id'] . '" data-email="' . $r['email'] . '" class="btn btn-danger btn-sm delete-entrant" title="Delete"><i class="btn-icon-only icon-trash"> </i></button> </div>';
             //'<button data-email="'.$r['email'].'" data-id="'.$r['id'].'" class="btn btn-success btn-sm message-entrant"  title="Send Message"><i class="btn-icon-only icon-envelope"> </i></button> ';
             $multiActionBox = '<input type="checkbox" class="multi-action-box" data-id="' . $r['id'] . '" />';
             $result[] = array(utf8_encode($multiActionBox), utf8_encode($actionButtons), $r['id'], utf8_encode(Contest::getName(self::$dbObj, $r['contest'])), utf8_encode($r['email']), utf8_encode(str_replace(",", ", ", $r['friends'])), utf8_encode($r['names']), utf8_encode($r['time_entered']), utf8_encode($r['point']));
         }
         $json = array("status" => 1, "draw" => intval($draw), "recordsTotal" => intval($totalData), "recordsFiltered" => intval($totalFiltered), "data" => $result);
     } else {
         $json = array("status" => 2, "msg" => "Necessary parameters not set. Or empty result. " . mysqli_error(self::$dbObj->connection), "draw" => intval($draw), "recordsTotal" => intval($totalData), "recordsFiltered" => intval($totalFiltered), "data" => false);
     }
     self::$dbObj->close();
     header('Content-type: application/json');
     return json_encode($json);
 }
開發者ID:Mojolagbe2014,項目名稱:mojokalokalo,代碼行數:32,代碼來源:Entrant.php


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