当前位置: 首页>>代码示例>>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;未经允许,请勿转载。