HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/itpartnership.net (cms)/modules/FeedbackForm/classes/Config.class.php
<?php
// Feedback Form. 02/2005 SjG <feedbackform_cmsmodule@fogbound.net>
// A Module for CMS Made Simple, (c)2005 by Ted Kulp (wishy@cmsmadesimple.org)
// This project's homepage is: http://www.cmsmadesimple.org

// now is basically global variable store for all of the FeedbackForm module

class ffConfig {

    var $ConfigId=-1;
    var $FromName='Webmaster';
    var $FromAddress='you@your.domain';
    var $RootPath;
    var $MaxUploadSize;
    var $ModuleInputPrefix;
    var $UseCSS=0;
    var $TitlePosition=0;
    var $HideErrors=0;
    var $UseIDAndName=0;

    var $DBHandle;
    var $FormTableName;
    var $FieldTableName;
    var $OptionTableName;
    var $ConfigTableName;
    var $FlockTableName;
    
    var $selfptr;

	function ffConfig($params=array())
	{
	   if (ffUtilityFunctions::def($params['config_id']))
	       {
	       $this->ConfigId = $params['config_id'];
	       }
	   if (ffUtilityFunctions::def($params['from_name']))
	       {
	       $this->FromName = $params['from_name'];
	       }
	   if (ffUtilityFunctions::def($params['from_address']))
	       {
	       $this->FromAddress = $params['from_address'];
	       }
	   if (ffUtilityFunctions::def($params['css_layout']))
	       {
	       $this->UseCSS = $params['css_layout'];
	       }
	   if (ffUtilityFunctions::def($params['use_id_and_name']))
	       {
	       $this->UseIDAndName = $params['use_id_and_name'];
	       }
	   if (ffUtilityFunctions::def($params['table_layout_title_pos']))
	       {
	       $this->TitlePosition = $params['table_layout_title_pos'];
	       }
	   if (ffUtilityFunctions::def($params['hide_errors']))
	       {
	       $this->HideErrors = $params['hide_errors'];
	       }
	}

	function Lang($str)
	{
		return $this->selfptr->Lang($str);
	}

    function MergeConfig($conf)
    {
    	$this->DBHandle = $conf->DBHandle;
    	$this->FormTableName = $conf->FormTableName;
    	$this->FieldTableName = $conf->FieldTableName;
    	$this->OptionTableName = $conf->OptionTableName;
    	$this->ConfigTableName = $conf->ConfigTableName;
    	$this->FlockTableName = $conf->FlockTableName;
    	$this->RootPath = $conf->RootPath;
    }


	function DebugDisplay()
	{
		echo "Config Id: ".$this->ConfigId."<br />";
		echo "Config Email \"From\" Name: ".$this->FromName."<br />";
		echo "Config Email \"From\" Address: ".$this->FromAddress."<br />";
		echo "Config Pure CSS Layout: ".$this->UseCSS."<br />";
		echo "Config Use CSS ID and Name: ".$this->UseIDAndName. "<br />";
		echo "Config Hide Errors: ".$this->HideError."<br />";
	}

    function Load()
    {
        $sql = 'SELECT * FROM ' . $this->ConfigTableName . ' WHERE config_id=1';
	    $rs = $this->DBHandle->Execute($sql);
        if($rs && $rs->RecordCount() > 0)
	       {
	       $result = $rs->GetArray();
           $this->ConfigId = $result[0]['config_id'];
           $this->FromName = $result[0]['from_name'];
	       $this->FromAddress = $result[0]['from_address'];
	       if (ffUtilityFunctions::def($result[0]['use_css']))
	       	   {
	       	   $this->UseCSS = $result[0]['use_css'];
           	   }
	       if (ffUtilityFunctions::def($result[0]['use_id_and_name']))
	       	   {
	       	   $this->UseIDAndName = $result[0]['use_id_and_name'];
           	   }
	       if (ffUtilityFunctions::def($result[0]['title_pos']))
	       	   {
	       	   $this->TitlePosition = $result[0]['title_pos'];
           	   }
	       if (ffUtilityFunctions::def($result[0]['hide_errors']))
	       	   {
	       	   $this->HideErrors = $result[0]['hide_errors'];
           	   }
           }
    }


    function Store()
    {
        if ($this->ConfigId == -1)
            {
            $this->ConfigId = 1;
			$sql = 'INSERT INTO ' . $this->ConfigTableName .
                " (config_id, from_name, from_address, css_layout, use_id_and_name, title_pos) VALUES (?, ?, ?, ?, ?, ?, ?)";
			$res = $this->DBHandle->Execute($sql, array($this->ConfigId, $this->FromName,
                $this->FromAddress, $this->UseCSS, $this->UseIDAndName, $this->TitlePosition,
                $this->HideErrors));
            }
        else
            {
			$sql = 'UPDATE ' . $this->ConfigTableName . " set from_name=?, from_address=?, " .
                "use_css=?, use_id_and_name=?, title_pos=?, hide_errors=? where config_id=?";
			$res = $this->DBHandle->Execute($sql, array($this->FromName,
                $this->FromAddress, $this->UseCSS,
                $this->UseIDAndName,
                $this->TitlePosition, $this->HideErrors, $this->ConfigId));
            }
        return $res;
    }

}

?>