Company
Company Du er her: /  Forsiden  /  Kildekoden  /  Layout  /  Company   Login nu   Login
Company
 ««« Se kilde koden
Company
Company Basic Company Company Base Company Company Component Company Company Db Company Company Dto Company Company Form Company Company Form-elements Company Company Jquery Company Company Layout  Company Company Menu Company Company Menu-fisheye Company Company Mvc Company Company Tab Company Company Table Company Company Template Company Company Util Company
Company
Company
Company Index
 
Tilbage

Navn : Company.php


Sample code, tutorial

Sådan benyttes komponenten Company klassen

Først skal du inkludere den fil der beskriver komponenten, som en klasse fil

  • <?
    require_once(HTML_PACKAGE_PATH.'/Company.php');
    ?>

Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):

  • <?
    Company
    ::display($param1, $param2, $param3, ...);
    ?>

eller du kan lave en instance af komponenten og benytte metoderne direkte:

  • <?
    $object
    = new Company($param1, $param2, $param3, ...);
    print
    $object->getHtml();
    ?>

Parent html

Sådan vises komponenten Company klassen

Company Company - Webmaster, Udvikling og Design af disse hjemmesider -
     Hvepse Eksperten Finn Rasmussen  Company
   Company name  HvepseEksperten.dk ApS   
   Contact person  Finn-Rasmussen   
   Address  Kongens Vænge 79   
   Zip  3400   
   City  Hillerød   
   Country  Denmark   
   Mobile phone  (+45) 40 50 60 69   
   Business phone  (+45) 48 24 60 30   
   Email  Kontakt   
   Www  http://www.hvepseeksperten.dk   
   Cvr nr  10142865   
   Bank name  Den Danske Bank, Hilleød   
   Bank account  Du skal ringe for at få konto no oplyst   

PHP source code

Den fulde PHP kildekode for Company klassen

<?
/**
* @package layout
* @see HTML_LAYOUT_PAGE_PATH.'/Company.php'
* @copyright (c) http://Finn-Rasmussen.com
* @license http://Finn-Rasmussen.com/license/ myPHP License conditions
* @author http://Finn-Rasmussen.com
* @version 1.10
* @since 22-feb-2007
*/

/**
* The required files
*/
require_once(HTML_TABLE_COMPONENT_PATH.'/TableHeader.php');
require_once(
HTML_TABLE_COMPONENT_PATH.'/Table.php');
require_once(
HTML_BASE_UTIL_PATH.'/Link.php');
require_once(
HTML_BASE_UTIL_PATH.'/Image.php');
if (
defined('HTML_LANGUAGE_UTIL_PATH')) {
    require_once(
HTML_LANGUAGE_UTIL_PATH.'/Translate.php');
}
if (
defined('HTML_LOG_UTIL_PATH')) {
    require_once(
HTML_LOG_UTIL_PATH.'/Log.php');
}

/**
* Used to get/display the Company Information
* <code>
* +-----------------------------------------+
* |  Company Information and picture       |
* +-----------------------------------------+
* Usage:
*   $html = new Company($text,$width,$class,$border,$cellPadding,$cellSpacing);
*   print $html->getHtml();
* Or
*   Company::display($text,$width,$class,$border,$cellPadding,$cellSpacing);
* </code>
* @package layout
*/

class Company extends Table {
    var
$text            = ''; // Header text

    
var $company_name    = '';
    var
$contact_person  = '';
    var
$address         = '';
    var
$zip             = '';
    var
$city            = '';
    var
$country         = '';
    var
$private_phone   = '';
    var
$mobile_phone    = '';
    var
$phone           = '';
    var
$fax             = '';
    var
$email           = '';
    var
$www             = '';
    var
$se_nr           = '';
    var
$cvr_nr          = '';
    var
$bank_name       = '';
    var
$bank_account    = '';

    var
$picture         = '';
    
    
/**
     * Constructor
     * @param String $text   The text of the table
     * @param String $width  The width of the table, default 100%
     * @param String $class  The css class to use
     * @param String $border The table border
     * @param String $cellpadding The Cell Padding
     * @param String $cellspacing The Cell Spacing
     * @global String IMG_PATH, The path to the images dir
     */
    
function Company($text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
        
$theClass = $class!=''?$class:CSS_BORDER;
        
$this->Table($text,$width,$theClass,$border,$cellpadding,$cellspacing,$summary,$caption);
        
$this->text = $text!=''?$text:'Company - '.TEXT_COMPANY_PROFILE.' -';

        
$this->company_name    = LINK_TEXT;
        
$this->contact_person  = MY_SELF;
        
$this->address         = 'Kongens V&aelig;nge 79';
        
$this->zip             = '3400';
        
$this->city            = 'Hiller&oslash;d';
        
$this->country         = 'Denmark';
        
$this->private_phone   = '';
        
$this->mobile_phone    = MOBILE_PHONE;
        
$this->business_phone  = '(+45) 48 24 60 30';
        
//$this->fax             = '(+45) 48 24 60 37';
        
$this->email           = LINK_HREF_EMAIL;
        
$this->www             = LINK_HREF_URL;
        
$this->se_nr           = '10142865';
        
$this->cvr_nr          = '10142865';
        
$this->bank_name       = 'Den Danske Bank, Hille&oslash;d';
        
$this->bank_account    = 'Du skal ringe for at få konto no oplyst';
    }

    
/**
     * Get the CSS class Name for this component
     * @return String The CSS class name
     */
    
function getCssClass() {
        return
CSS_COMPANY;
    }

    
/**
     * Toogle the request parameters which will minimize or maximize this component
     * @return array The array of key=>value pair
     */
    
function getMinimize() {
        return
$this->getToogle(REQUEST_LAYOUT_SHOW, LAYOUT_SHOW, LAYOUT_SHOW_COMPANY);
    }

    
/**
     * Builds the html, and return it for a Customer Information
     * @return String The html
     */
    
function getHtml() {
        
$html  = $this->html;
        if (
LAYOUT_SHOW & LAYOUT_SHOW_COMPANY && HTTP_USER_AGENT!=HTTP_USER_AGENT_P900) {
            if (
CACHE_LAYOUT && $this->getCacheFileName(CACHE_LAYOUT_PATH)!='' && file_exists($this->getCacheFileName(CACHE_LAYOUT_PATH))) {
                
$html .= $this->content($this->getCacheFileName(CACHE_LAYOUT_PATH));
            } else {
                if (
$this->contact_person==MY_SELF) {
                    
$this->picture = '/finn.jpg'; // 100x136
                
}
                
// Render it
                
$html .= $this->getTableHeader();
                
$html .= $this->getStart();
                
$html .= $this->getInfo('picture'); // Must be the very first, due to rowspan
                
$html .= $this->getInfo('company_name');
                
$html .= $this->getInfo('contact_person');
                
$html .= $this->getInfo('address');
                
$html .= $this->getInfo('zip');  
                
$html .= $this->getInfo('city');
                
$html .= $this->getInfo('country');
                
$html .= $this->getInfo('private_phone');
                
$html .= $this->getInfo('mobile_phone');
                
$html .= $this->getInfo('business_phone');
                
$html .= $this->getInfo('fax');
                
$html .= $this->getInfo('email');
                
$html .= $this->getInfo('www');
                
//$html .= $this->getInfo('se_nr');
                
$html .= $this->getInfo('cvr_nr');
                
$html .= $this->getInfo('bank_name');
                
$html .= $this->getInfo('bank_account');
                
$html .= $this->getEnd();
                if (
CACHE_LAYOUT) {
                    
$this->save($html, CACHE_LAYOUT_PATH);
                }
            }
        } else {
               
$html .= $this->getMaximize();
        }
        return
$html;
    }

    
/**
     * Get the html for each row, and return it
     * @return String The html
     */
    
function getInfo($info) {
        
$html  = '';
        
$class = $this->getCssClass();
        if (
$this->$info!='') {
            
$keyInfo = $info;
            if (
defined('HTML_LANGUAGE_UTIL_PATH')) {
                
$keyInfo = Translate::sql($info);
                if (
defined($keyInfo)) {
                    
$keyInfo = constant($keyInfo);
                } else {
//                    $msg = LANGUAGE."=languge, Unknown translation for: $info";
//                    if (defined('HTML_LOG_UTIL_PATH')) {
//                        //Log::error(__FILE__,__LINE__,$msg);
//                    } else {
//                    }
//                    Message::add($msg, __FILE__, __LINE__);
                
}
            }
            
$key   = ucfirst(str_replace('_','&nbsp;', $keyInfo));
            
$value = $this->$info;
            switch (
$info) {
                case
'email':
                    
$link = new Link(LINK_TEXT_CONTACT_US,$value,$class,LINK_TITLE_CONTACT_US);
                    
$value = $link->getHtml();
                    break;
                case
'www':
                    
$link = new Link($value,$value,$class,LINK_TITLE_VISIT_US.$value);
                    
$value = $link->getHtml();
                    break;
                case
'picture':
                    
$image = new Image($value,'100','136','Hvepse Eksperten Finn Rasmussen',CSS_COMPANY.' '.CSS_FLOAT_RIGHT);
                    
$value = $image->getHtml();  // TODO, how to float right ??? in a table??
                    
break;
                default:
                    break;
            }
            
$nbsp = '&nbsp;';
            switch (
$info) {
                case
'picture': // Rowspan
                    
$image = $this->newTriangle(IMAGE_TRIANGLE, $class);
                    
$html .= " <tr>\r\n";
                    
$html .= '  <td class="'.$class.'">'.$nbsp."</td>\r\n";
                    
$html .= '  <td class="'.$class.'">'.$nbsp."</td>\r\n";
                    
$html .= '  <td class="'.$class.'" rowspan="15" valign="top">'.$nbsp.$value."</td>\r\n";
                    
$html .= '  <td class="'.$class.'">'.$nbsp.$image->getHtml()."</td>\r\n";
                    
$html .= " </tr>\r\n";
                    break;
                default:
                    
$html .= " <tr>\r\n";
                    
$html .= '  <td class="'.$class.'" valign="top">'.$nbsp.$nbsp.$nbsp.$key.$nbsp."</td>\r\n";
                    
$html .= '  <td class="'.$class.'" valign="top">'.$value.$nbsp."</td>\r\n";
                    
$html .= '  <td class="'.$class.'" valign="top">'.$nbsp."</td>\r\n";
                    
//$html .= '  <td class="'.$class.'">'.$nbsp."</td>\r\n";
                    //$html .= '  <td class="'.$class.'">'.$nbsp."</td>\r\n";
                    
$html .= " </tr>\r\n";
                    break;
            }
        }
        return
$html;
    }

    
/**
    * Display html
    * <code>
     * Usage:
     *    Company::display($text,$width,$class,$border,$cellpadding,$cellspacing);
     * </code>
     * @static
     * @param String $text   The text of the table
     * @param String $width  The width of the table, default 100%
     * @param String $class  The css class to use
     * @param String $border The table border
     * @param String $cellpadding The Cell Padding
     * @param String $cellspacing The Cell Spacing
     */
    
function display($text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
        
$html = new Company($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
        
$html->addHtml();
    }
}
?>

HTML source code

Den fulde HTML kildekode for Company klassen

<?

<table width="100%" class="baseBorder" border="0" cellpadding="2" cellspacing="0">
<
tr>
    <
td class="baseArrowHeader" valign="middle"><img src="/images/arrow-headline.gif" width="4" height="7" alt="Company" />
</
td>
  <
th class="baseColorHeader" valign="top" align="left">Company - Webmaster, Udvikling og Design af disse hjemmesider -</th>

</
tr>

</
table>

<
table width="100%" class="baseBorder" border="0" cellpadding="2" cellspacing="0">
<
tr>
  <
td class="layoutCompany">&nbsp;</td>
  <
td class="layoutCompany">&nbsp;</td>
  <
td class="layoutCompany" rowspan="15" valign="top">&nbsp;<img src="/images/finn.jpg" width="100" height="136" alt="Hvepse Eksperten Finn Rasmussen" class="layoutCompany baseFloatRight" /></td>
  <
td class="layoutCompany">&nbsp;<img src="/images/triangle.gif" width="10" height="10" alt="Company" class="layoutCompany" /></td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Company&nbsp;name&nbsp;</td>
  <
td class="layoutCompany" valign="top">HvepseEksperten.dk ApS&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Contact&nbsp;person&nbsp;</td>
  <
td class="layoutCompany" valign="top">Finn-Rasmussen&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Address&nbsp;</td>
  <
td class="layoutCompany" valign="top">Kongens V&aelig;nge 79&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Zip&nbsp;</td>
  <
td class="layoutCompany" valign="top">3400&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;City&nbsp;</td>
  <
td class="layoutCompany" valign="top">Hiller&oslash;d&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Country&nbsp;</td>
  <
td class="layoutCompany" valign="top">Denmark&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Mobile&nbsp;phone&nbsp;</td>
  <
td class="layoutCompany" valign="top">(+45) 40 50 60 69&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Business&nbsp;phone&nbsp;</td>
  <
td class="layoutCompany" valign="top">(+45) 48 24 60 30&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Email&nbsp;</td>
  <
td class="layoutCompany" valign="top"><!-- Kontakt --><a id="Link40" class="layoutCompany" href="http://www.hvepseeksperten.dk/FormMail/" title="Kontakt via email&#013;">Kontakt</a>&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Www&nbsp;</td>
  <
td class="layoutCompany" valign="top"><!-- http://www.hvepseeksperten.dk --><a id="Link41" class="layoutCompany" href="http://www.hvepseeksperten.dk" title="Bes&oslash;g vores hjemmeside: http://www.hvepseeksperten.dk">http://www.hvepseeksperten.dk</a>&nbsp;</td>
  
<td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Cvr&nbsp;nr&nbsp;</td>
  <
td class="layoutCompany" valign="top">10142865&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Bank&nbsp;name&nbsp;</td>
  <
td class="layoutCompany" valign="top">Den Danske Bank, Hille&oslash;d&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
<
tr>
  <
td class="layoutCompany" valign="top">&nbsp;&nbsp;&nbsp;Bank&nbsp;account&nbsp;</td>
  <
td class="layoutCompany" valign="top">Du skal ringe for at få konto no oplyst&nbsp;</td>
  <
td class="layoutCompany" valign="top">&nbsp;</td>
</
tr>
</
table>

?>

Class methods

Her er 'klasse metoderne' for Company klassen:

  • object
  • getclassname
  • getmsg
  • addhtml
  • gethtml
  • tostring
  • getcachefilename
  • save
  • content
  • stop
  • html
  • setobject
  • set
  • get
  • getattribute
  • gettag
  • add
  • getsizeof
  • getelement
  • getelements
  • gettoogle
  • getmaximize
  • getminimize
  • newtriangle
  • display
  • showsource
  • table
  • newtextrow
  • gettableheader
  • getstart
  • getend
  • start
  • end
  • company
  • getcssclass
  • getinfo

Object vars

Her er 'objekt variable' for Company klassen:

  • html =>
  • sql =>
  • elements => Array
  • sizeof => 0
  • text => Company - Webmaster, Udvikling og Design af disse hjemmesider -
  • width => 100%
  • class => baseBorder
  • border => 0
  • cellpadding => 2
  • cellspacing => 0
  • summary =>
  • caption =>
  • company_name => HvepseEksperten.dk ApS
  • contact_person => Finn-Rasmussen
  • address => Kongens Vænge 79
  • zip => 3400
  • city => Hillerød
  • country => Denmark
  • private_phone =>
  • mobile_phone => (+45) 40 50 60 69
  • phone =>
  • fax =>
  • email => http://www.hvepseeksperten.dk/FormMail/
  • www => http://www.hvepseeksperten.dk
  • se_nr => 10142865
  • cvr_nr => 10142865
  • bank_name => Den Danske Bank, Hilleød
  • bank_account => Du skal ringe for at få konto no oplyst
  • picture => /finn.jpg
  • business_phone => (+45) 48 24 60 30

Company Company - Webmaster, Udvikling og Design af disse hjemmesider -
     Hvepse Eksperten Finn Rasmussen  Company
   Company name  HvepseEksperten.dk ApS   
   Contact person  Finn-Rasmussen   
   Address  Kongens Vænge 79   
   Zip  3400   
   City  Hillerød   
   Country  Denmark   
   Mobile phone  (+45) 40 50 60 69   
   Business phone  (+45) 48 24 60 30   
   Email  Kontakt   
   Www  http://www.hvepseeksperten.dk   
   Cvr nr  10142865   
   Bank name  Den Danske Bank, Hilleød   
   Bank account  Du skal ringe for at få konto no oplyst   
Company

Vis denne side på danmark

Vis denne side på Germany

Vis denne side på England

Vis denne side på France

Vis denne side på Italy

Vis denne side på Norge

Vis denne side på Sverige

Vis denne side på USA


 
Company