Advertisement
terorama

slider / autoinfo.inc.php

Aug 21st, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <?php
  2.  
  3. class AutoInfo {
  4.  
  5.    const STAT_ERROR=2;
  6.    const STAT_OK=0;
  7.    
  8.    public $status;
  9.    public $status_message;
  10.    public $myname;
  11.    //--------------------------------------------------
  12.    function __construct($inname) {
  13.    
  14.       $this->myname=$inname;
  15.       $this->status=0;
  16.    }
  17.    //--------------------------------------------------
  18.    protected function set_error ($statmessage) {
  19.       $this->status = AutoInfo::STAT_ERROR;
  20.       $this->status_message=$statmessage;
  21.    }
  22.    //--------------------------------------------------
  23.    protected function set_ok() {
  24.       $this->status = AutoInfo::STAT_OK;
  25.       $this->status_message="";      
  26.    }
  27.    //--------------------------------------------------
  28.    public function is_error() {
  29.       if ($this->status==AutoInfo::STAT_ERROR)
  30.          return true;
  31.       else
  32.          return false;   
  33.    }
  34.    //--------------------------------------------------
  35.    public function get_error() {
  36.       return $this->myname.': '.$this->status_message;
  37.    }
  38.    //--------------------------------------------------
  39.    public function show_status() {
  40.       if ($this->is_error())
  41.          return $this->get_error();
  42.       else  
  43.          return 'status ok';
  44.    }
  45.    //--------------------------------------------------
  46. }
  47.  
  48.  
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement