update('CommandesKbis')
->Where('id = ?', $identifiant);
} else {
$q = Doctrine_Query::create()
->update('Commandes')
->Where('idCommande = ?', $identifiant);
}
$q->set('statutCommande', $statut);
$rows = $q->execute();
$firephp->log($rows, 'rows');
if ( count($rows)>0 ){
//Liste des statuts
$q = Doctrine_Query::create()
->from('CommandesStatut')
->where('typeCommande = ?', 'C')
->andWhere('id = ?', $statut);
$statut = $q->fetchOne();
$output = ''.$statut->libStatut.'';
if ( $statut->ordre==3 ){
$output.=
'
'.
'Générer le courrier';
}
}
echo $output;
// Fin change etat
} elseif ($params[1]=='erreur') {
$idCommande = $params[2];
?>
update('Commandes')
->set('statutCommande', '?', $_REQUEST['statutCommande'])
->set('commentaire', '?', $_REQUEST['commentaire'])
->where('idCommande = ?', $_REQUEST['idCommande']);
//echo $q->getSql();
//print_r($q->getFlattenedParams());
echo $rows = $q->execute();
} elseif ($params[1]=='rs') {
try {
$O = $client->getIdentite($_REQUEST['siren'], 0, false);
echo $O['result']['Nom'];
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$tabInfo);
}
}
break;
//Gestion des logos
case 'logo':
$subaction = $params[1];
switch ( $subaction ) {
//upload
case 'upload':
$siren = isset($_REQUEST['siren']) ? $_REQUEST['siren'] : $params[2] ;
require_once realpath(dirname(__FILE__)).'/saisie_logo_upload.php';
break;
//crop
case 'crop':
$image = $params[2];
require_once realpath(dirname(__FILE__)).'/saisie_logo_crop.php';
break;
case 'save':
$file = isset($params[2]) ? $params[2] : '';
require_once realpath(dirname(__FILE__)).'/saisie_logo_save.php';
break;
case 'url':
$siren = isset($_REQUEST['siren']) ? $_REQUEST['siren'] : $params[2] ;
require_once realpath(dirname(__FILE__)).'/saisie_logo_url.php';
break;
//Suppression
case 'delete':
$file = isset($_REQUEST['file']) ? $_REQUEST['file'] : '' ;
require_once realpath(dirname(__FILE__)).'/saisie_logo_delete.php';
break;
//Affichage
default:
require_once realpath(dirname(__FILE__)).'/saisie_logo.php';
$siren = isset($_POST['siren']) ? $_POST['siren'] : '' ;
$isin = isset($_POST['isin']) ? $_POST['isin'] : '' ;
$logo = saisie_findlogo($siren, $isin);
if ( !empty($logo) ){
$output = '';
} else {
$output = '';
}
echo $output;
break;
}
break;
case 'annonces':
$subaction = $params[1];
require_once realpath(dirname(__FILE__)).'/saisie_annonces.php';
break;
default: break;
}