Exemple #1
0
 /**
  * Check if data exits
  *
  * @return bool
  */
 public static function dataExists()
 {
     $patch_manager = new SimpleInvoices_Db_Table_SQLPatchManager();
     if ($patch_manager->getCount() > 0) {
         return true;
     } else {
         return false;
     }
 }
include_once("sys/include/class/index.php");
$db = db::getInstance();

include_once("sys/include/sql_queries.php");

$install_tables_exists = SimpleInvoices_Db::tableExists("biller");
if ($install_tables_exists == true)
{
	$install_data_exists = SimpleInvoices_Db::dataExists();
}

//TODO - add this as a function in sql_queries.php or a class file
//if ( ($install_tables_exists != false) AND ($install_data_exists != false) )
if ( $install_tables_exists != false )
{
	if (SimpleInvoices_Db_Table_SQLPatchManager::getNumberOfDoneSQLPatches() > "196")
	{
        $SI_EXTENSIONS = new SimpleInvoices_Db_Table_Extensions();
        // ToDo: Watch out! This get's translated while the original doesn't!!!
        $extensions = $SI_EXTENSIONS->fetchAll();
        $DB_extensions = array();
        foreach($extensions as $this_extension) {
            $DB_extensions[$this_extension['name']] = $this_extension;
        }
        /*
	    $sql="SELECT * from ".TB_PREFIX."extensions WHERE (domain_id = :id OR domain_id =  0 ) ORDER BY domain_id ASC";
	    $sth = dbQuery($sql,':id', $auth_session->domain_id ) or die(htmlsafe(end($dbh->errorInfo())));

	    while ( $this_extension = $sth->fetch() )
	    {
	    	$DB_extensions[$this_extension['name']] = $this_extension;