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


PHP Converter::unConvert方法代码示例

本文整理汇总了PHP中Converter::unConvert方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::unConvert方法的具体用法?PHP Converter::unConvert怎么用?PHP Converter::unConvert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Converter的用法示例。


在下文中一共展示了Converter::unConvert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRoutejson

 public function getRoutejson($_routeid)
 {
     require '/var/www/db-init-climb.php';
     require 'Comment.class.php';
     $comment = new Comment();
     $stmt = $db->prepare("SELECT RouteId, Name, Grade, Description \n    FROM Route \n    WHERE RouteId=:routeid");
     $stmt->execute([':routeid' => $_routeid]);
     $data = $stmt->fetch(PDO::FETCH_ASSOC);
     $data['Grade'] = preg_replace('/-/', '', parent::unConvert($data['Grade']));
     $muuttuja = $comment->getComments($_routeid, 'route');
     $muuttuja = $muuttuja->fetchAll();
     $data['Image'] = $this->loadRoutePic($_routeid);
     $data['Comments'] = $muuttuja;
     echo json_encode($data);
 }
开发者ID:pekka-m,项目名称:ClimbingWeb,代码行数:15,代码来源:Route.class.php

示例2: date

echo "<h3>";
$startTime = strtotime($pstat['StartTime']);
$endTime = strtotime($pstat['EndTime']);
echo date("d.m.Y", $startTime) . " klo " . date("H:i", $startTime) . " - " . date("H:i", $endTime);
echo "</h3>";
echo "<h3>Toppaukset</h3>";
//ollaan valittu ulkoharjoitus
if ($pstat['IsOutside']) {
    $cursor = $estats->getExercises($id, "outdoor-top");
    foreach ($cursor as $object) {
        $route = new Route($object['RouteId']);
        $routeRow = $route->getRoute();
        echo "<div class='practice'>";
        echo "Crag: <a href='showcrag.php?cid={$routeRow['CragId']}'>" . $routeRow['CragName'] . "</a><br>";
        echo "Reitti: " . $routeRow['RouteName'] . "<br>";
        echo "Grade: " . preg_replace('/-/', '', $converter->unConvert($estats->getRouteGrade($object['RouteId'])));
        echo "</div>";
    }
    unset($route);
    unset($routeRow);
} else {
    $cursor = $estats->getExercises($id, "indoor-top");
    foreach ($cursor as $object) {
        $route = new Route($object['RouteId']);
        $routeRow = $route->getRoute();
        echo "<div class='practice'>";
        echo "Grade: " . preg_replace('/-/', '', $converter->unConvert($object['Grade']));
        echo "</div>";
    }
}
echo "<h3>Yritykset</h3>";
开发者ID:pekka-m,项目名称:ClimbingWeb,代码行数:31,代码来源:single-stat.php

示例3: getAvgGrade

 /**
  * Laskee kaikkien kiipeilysuoritusten keskiarvograden (Sisä ja ulko).
  * @return string Keskiarvograde.
  */
 public function getAvgGrade()
 {
     $sum = 0;
     $count = 0;
     $cursor = $this->collection->find(['UserId' => $_SESSION['logged_user'], 'Type' => 'indoor-top']);
     foreach ($cursor as $object) {
         $sum += $object['Grade'];
         $count++;
     }
     $cursor = $this->collection->find(['UserId' => $_SESSION['logged_user'], 'Type' => 'outdoor-top']);
     foreach ($cursor as $object) {
         $sum += $this->getRouteGrade($object['RouteId']);
         $count++;
     }
     return parent::unConvert(round($sum / $count));
 }
开发者ID:pekka-m,项目名称:ClimbingWeb,代码行数:20,代码来源:Exercise.class.php


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