Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/dev/htdocs/custom/customizeforms/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/dev/htdocs/custom/customizeforms/lib/customizeinterface.php
<?php
/*  Copyright (C) 2019 Customizeforms Paulo Ricardo Carvalho de Oliveira	<paulorcdo@gmail.com>
 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

 
/**
 *	\file       lib/customizeinterface.php
 *	\brief      select features
 */
class Customizeconfig
{

    var $db;
    

    /**
     *  Constructor
     *
     *  @param	DoliDb		$db      Database handler
     */
    function __construct($db)
    {
        $this->db = $db;
        return 1;
    }

   
    
      function get_customization()
    {
        
         $outr='';  
 $urlinta=explode("/",$_SERVER['REQUEST_URI']);
 $urlint=array_reverse($urlinta);
 $pagina=explode("?",$urlint[0]);
 
 if($urlint[2]=='comm'||$urlint[2]=='compta'||$urlint[2]=='fourn'||$urlint[2]=='product'||$urlint[2]=='user'||$urlint[2]=='asset') {  
  $sm= $urlint[2];
 }else{
        $sm= '';
 }
         $acao='create';
      //if($_GET["action"]!="")
      //{
      //  $acao=$_GET["action"];
      //}
       if($_POST["action"]=="add") {
       $acao='create';
        }
        global $langs,$conf;
        $sql = "SELECT * FROM ".MAIN_DB_PREFIX."customizeforms as t";
        $sql.= " WHERE t.modulo = '" . $sm."'";
        $sql.= " AND t.submodulo = '" . $urlint[1]."'";
        $sql.= " AND t.pagina = '" .  $pagina[0]."'";
       // $sql.= " AND t.acao = '".$acao."'";         
 
          $sql.= " order by rowid asc;";        
      //  dol_syslog(get_class($this) . "::fetch_from_user sql=" . $sql, LOG_DEBUG);
      
    // echo $sql;
      
        $resql = $this->db->query($sql);
if ($resql)
	{
	
		// Construct $out and $outarray
        
        $sit0=[];
        $sit1=[];
        $sit2=[];
        $sit3=[];
        $vp=[];
        $lab=[];
        $too=[];
        $con=[];
        $retorno=[];
		$outr.= ' ';

		$num = $this->db->num_rows($resql);
		$i = 0;
		if ($num)
		{
			while ($i < $num)
			{
			 		$obj = $this->db->fetch_object($resql);
                    
                    if($obj->situacao==0)
                    {
                        array_push($sit0 ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->situacao,$obj->form_nome));  }
                     if($obj->situacao==1)
                    {
                        
                        if($obj->campo_nome=='cabecalho'||$obj->campo_nome=='rodape')
                        array_push($sit1 ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->situacao,$obj->form_nome));  }
                    if($obj->situacao==2)
                    {  array_push($sit2 ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->situacao,$obj->form_nome));  }
                    if($obj->situacao==3)
                    {  array_push($sit3 ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->situacao,$obj->form_nome));  }
 
                     if($obj->valor_padrao!='')
                    {  array_push($vp ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->valor_padrao,$obj->form_nome));  }
                    if($obj->label!='')
                    {  array_push($lab ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->label,$obj->form_nome));  }
 
                     if($obj->tooltip!='')
                    {  array_push($too ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->tooltip,$obj->form_nome));  }
 
                     if($obj->conteudo!='')
                    {  array_push($con ,array($obj->rowid,$obj->campo_nome,$obj->campo_tipo,$obj->campo_texto,$obj->extra,$obj->conteudo,$obj->form_nome));  }
 
				$i++;
				 
			}
		}

 
	$retorno["sit0"]=$sit0;
	$retorno["sit1"]=$sit1;
	$retorno["sit2"]=$sit2;
	$retorno["sit3"]=$sit3;
    
    	$retorno["vp"]=$vp;
    
    $retorno["lab"]=$lab;
    $retorno["too"]=$too;
    $retorno["con"]=$con;
    
 $this->response=$retorno;

	}
        else
        {
            $this->error = "Error " . $this->db->lasterror();
            dol_syslog(get_class($this) . "::fetch_from_user " . $this->error,
                                 LOG_ERR);
            return -1;
        }
    }
     
    
}

?>

Hry