<?php

/**
 * Subclass for representing a row from the 'tblblogcheckinfo' table.
 *
 * 
 *
 * @package lib.model
 */ 
class Tblblogcheckinfo extends BaseTblblogcheckinfo
{
	/**
	 * Initializes internal state of Tblblogcheckinfo object.
	 * @see        parent::__construct()
	 */
	public function __construct()
	{
		// Make sure that parent constructor is always invoked, since that
		// is where any default values for this object are set.
		parent::__construct();
	}

  public function getCiBadgeTitle() {
    $badgeid = explode(',', $this->getCiBadge());
    if (!isset($badgeid[0])) $badgeid[0] = 0;
    if (!isset($badgeid[1])) $badgeid[1] = 0;
    if (!isset($badgeid[2])) $badgeid[2] = 0;
    return
      blogStore::$acad_title[1][$badgeid[0]] .
      blogStore::$diploma[1][$badgeid[1]] .
      blogStore::$badge[1][$badgeid[2]];
  }

  public function getCiSubjectTitle() {
    $sub_id = explode(',', $this->getCiSubject());
    $subject = '';
    foreach ($sub_id as $id) {
      $sub1 = @blogStore::$subject1[$id];
      $sub2 = @blogStore::$subject2[$id];
      $subject .= ($subject==''? '': ', ').($sub1? $sub1: $sub2);
    }
    return $subject;
  }

  public function getCiPositionTitle() {
    $pos = $this->getCiPosition();
    if ($pos) return blogStore::$position[$pos];
    else return '';
  }
}
