changeset 91:0fbe77d68b9b

Prevent division by zero.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 12 Dec 2012 12:29:56 +0200
parents 556af969a248
children 54a24352e8e5
files index.php
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/index.php	Thu Oct 25 01:39:46 2012 +0300
+++ b/index.php	Wed Dec 12 12:29:56 2012 +0200
@@ -409,7 +409,8 @@
     "<div>".lukMsg("viikossa", $classInfo["totalHours"])."</div>\n".
     "<table class=\"timetable\">".
     " <tr>\n  <th></th>\n";
-    $cellWidth = 100 / $classInfo["maxDays"];
+    
+    $cellWidth = $classInfo["maxDays"] > 0 ? 100 / $classInfo["maxDays"] : 15;
     if ($cellWidth > 25) $cellWidth = 25;
 
     for ($day = 0; $day < $classInfo["maxDays"]; $day++)