From 17d7834455b9e307bb95cf18ca032429395204f6 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 Aug 2011 15:02:05 +0100 Subject: [PATCH] Contest: Fixed Serial number Bug where extra 0 are shown --- application/models/contests.php | 3 ++- application/views/contest/log.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/models/contests.php b/application/models/contests.php index 35ac5eef..4bcf77cd 100644 --- a/application/models/contests.php +++ b/application/models/contests.php @@ -11,7 +11,7 @@ class Contests extends CI_Model { function information($id) { $this->db->select('*'); $this->db->from('contests'); - //$this->db->where('id', $id); + $this->db->where('contests.template', $id); $this->db->join('contest_template', 'contest_template.id = contests.template'); $query = $this->db->get(); return $query->row(); @@ -116,6 +116,7 @@ class Contests extends CI_Model { } //$this->db->order_by("COL_PRIMARY_KEY", "asc"); $this->db->order_by("COL_TIME_ON", "desc"); + //$this->db->order_by("COL_STX_STRING", "ASC"); $this->db->limit(10); return $this->db->get($this->config->item('table_name')); diff --git a/application/views/contest/log.php b/application/views/contest/log.php index 23b8f285..d0a109a7 100644 --- a/application/views/contest/log.php +++ b/application/views/contest/log.php @@ -22,11 +22,11 @@ serial_num + 1; - if($serial_number <= 49) { + if($serial_number <= 009) { $new_serial = "00".$serial_number; } - if($serial_number >= 49 && $serial_number <= 100) { + if($serial_number >= 010 && $serial_number <= 100) { $new_serial = "0".$serial_number; }