2009-12-04 17:17:09 +00:00
< ? php
/*
* Commande de pi<EFBFBD> ces
*/
if ( ! $_SESSION [ 'connected' ])
{
echo 'Vous devez <20> tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69> ' ;
exit ;
}
2009-12-23 10:20:29 +00:00
require_once 'user/user.php' ;
2009-12-04 17:17:09 +00:00
//Param<61> tres
$siret = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'siret' ]));
2010-01-12 15:32:56 +00:00
if ( strlen ( $siret ) <> 0 && strlen ( $siret ) <> 9 && strlen ( $siret ) <> 14 )
die ( 'Param<61> tres incorrects !' );
2009-12-04 17:17:09 +00:00
2010-01-12 15:32:56 +00:00
function sendCmdMail ( $sujet , $message )
{
require_once 'phpmailer/class.phpmailer.php' ;
$receptionCmd = array ( 'email' => 'pieces@scores-decisions.com' , 'nom' => 'Pieces' );
$mail = new PHPMailer ( true );
$mail -> IsSendmail ();
try
{
$body = $message ;
$body = eregi_replace ( " [ \ ] " , '' , $body );
$mail -> AddReplyTo ( 'contact@scores-decisions.com' , 'Contact Scores & D<> cisions' );
$mail -> SetFrom ( 'contact@scores-decisions.com' , 'Contact Scores & D<> cisions' );
$mail -> AddAddress ( $receptionCmd [ 'email' ], $receptionCmd [ 'nom' ]);
$mail -> Subject = $sujet ;
$mail -> MsgHTML ( $body );
$mail -> Send ();
}
catch ( phpmailerException $e )
{
//echo $e->errorMessage();
} catch ( Exception $e ) {
//echo $e->getMessage();
}
};
2010-01-08 10:17:59 +00:00
2009-12-11 15:12:58 +00:00
$firephp -> log ( $_REQUEST );
if ( isset ( $_REQUEST [ 'action' ]))
{
switch ( $_REQUEST [ 'action' ])
{
case 'kbis' :
if ( $_REQUEST [ 'method' ] == 'M' )
{
//V<> rification des champs
if ( ! empty ( $_REQUEST [ 'email' ]))
2010-01-12 15:32:56 +00:00
{
sendCmdMail ( '[COMMANDE PIECES] - KBIS par email' ,
'COMMANDE DE PIECES - Demande de kbis par email <br/>' . EOL .
'Demande pour recevoir le KBIS de SIREN :' .
'<a href="' . EXTRANET_URL . '/page=identite&siret=' . $_REQUEST [ 'siret' ] . '">' .
$_REQUEST [ 'siret' ] . '</a><br/>' . EOL .
'pour login ' . $_SESSION [ 'tabInfo' ][ 'login' ] . '(' . $_REQUEST [ 'email' ] . ')<br/>' . EOL .
'R<> f<EFBFBD> rence : ' . $_REQUEST [ 'ref' ]);
2009-12-11 15:12:58 +00:00
$message = 'Votre demande de reception de Kbis par email a <20> t<EFBFBD> prise en compte' ;
2010-01-08 10:17:59 +00:00
$client -> setLog ( 'kbis' , $_REQUEST [ 'siret' ], 0 , 'mail' );
2009-12-11 15:47:11 +00:00
unset ( $_REQUEST [ 'method' ]);
2009-12-11 15:12:58 +00:00
} else {
$message = '<font color="red">Erreur : adresse email non renseign<67> e.</font>' ;
}
}
elseif ( $_REQUEST [ 'method' ] == 'C' )
{
//V<> rification des champs
$fields = array ( 'societe' , 'nom' , 'prenom' , 'adresse' , 'cp' , 'ville' );
$error = false ;
foreach ( $fields as $field )
{
if ( empty ( $_REQUEST [ $field ])) $error = true ;
}
2010-01-12 15:32:56 +00:00
if ( ! $error )
{
sendCmdMail ( '[COMMANDE PIECES] - KBIS par courrier' ,
'COMMANDE DE PIECES - Demande de kbis par courrier' . EOL .
'Demande pour recevoir le kbis de siren : ' .
'<a href="' . EXTRANET_URL . '/page=identite&siret=' . $_REQUEST [ 'siret' ] . '">' .
$_REQUEST [ 'siret' ] . '</a><br/>' . EOL .
'pour login ' . $_SESSION [ 'tabInfo' ][ 'login' ] . '<br/>' . EOL .
'Societe :' . $_REQUEST [ 'societe' ] . '<br/>' . EOL .
'Nom : ' . $_REQUEST [ 'nom' ] . '<br/>' . EOL .
'Prenom : ' . $_REQUEST [ 'prenom' ] . '<br/>' . EOL .
'Adresse : ' . $_REQUEST [ 'adresse' ] . '<br/>' . EOL .
'CP : ' . $_REQUEST [ 'cp' ] . '<br/>' . EOL .
'Ville : ' . $_REQUEST [ 'ville' ]
);
2009-12-18 09:56:38 +00:00
$message = 'Votre commande <20> <20> t<EFBFBD> prise en compte, vous recevrez ce document sur votre e-mail' ;
2010-01-08 10:17:59 +00:00
$client -> setLog ( 'kbis' , $_REQUEST [ 'siret' ], 0 , 'courrier' );
2009-12-11 15:47:11 +00:00
unset ( $_REQUEST [ 'method' ]);
2009-12-11 15:12:58 +00:00
}
else
{
$message = '<font color="red">Erreur : Tous les champs doivent <20> tre renseigner.</font>' ;
}
}
break ;
case 'privileges' :
if ( ! empty ( $_REQUEST [ 'email' ]))
{
$privileges = join ( ', ' , $_REQUEST [ 'privileges' ][ 'type' ]);
2010-01-08 10:17:59 +00:00
$privilegesLog = join ( '-' , $_REQUEST [ 'privileges' ][ 'type' ]);
2009-12-11 15:12:58 +00:00
$firephp -> log ( $privileges , 'privileges' );
2010-01-12 15:32:56 +00:00
sendCmdMail ( " [COMMANDE PIECES] - PRIVILEGES par email " ,
'COMMANDE DE PRIVILEGES - par email<br/>' . EOL .
'Demande pour recevoir (' . $privileges . ') pour SIREN : ' .
'<a href="' . EXTRANET_URL . '/page=identite&siret=' . $_REQUEST [ 'siret' ] . '">' .
$_REQUEST [ 'siret' ] . '</a><br/>' . EOL .
'pour login ' . $_SESSION [ 'tabInfo' ][ 'login' ] . '(' . $_REQUEST [ 'email' ] . ')<br/>' . EOL .
'R<> f<EFBFBD> rence : ' . $_REQUEST [ 'ref' ]
);
2009-12-11 15:12:58 +00:00
$message = 'Votre commande a bien <20> t<EFBFBD> prise en compte, vous recevrez ces documents sur votre e-mail.' ;
2010-01-08 10:17:59 +00:00
$client -> setLog ( 'privileges' , $_REQUEST [ 'siret' ], 0 , 'mail:' . $privilegesLog );
2009-12-11 15:47:11 +00:00
unset ( $_REQUEST [ 'privileges' ][ 'type' ]);
2009-12-11 15:12:58 +00:00
} else {
$message = '<font color="red">Erreur : adresse email non renseign<67> e.</font>' ;
}
break ;
}
}
2009-12-04 17:17:09 +00:00
?>
< style >
2009-12-23 10:20:29 +00:00
. marge { margin - left : 30 px ;}
2009-12-04 17:17:09 +00:00
#identite { margin-left:30px; }
form { }
form em { color : #FF0000;}
fieldset { border : 0 ; margin : 0 ; padding : 0 ;}
fieldset legend { padding : 0 0 0 10 px ;}
. fieldgrp { clear : both ; margin : 0 0 . 5 em 30 px ; overflow : hidden ;}
. fieldgrp : after { content : " . " ; display : block ; clear : both ; visibility : hidden ; line - height : 0 ; height : 0 ; }
2009-12-11 15:12:58 +00:00
. fieldgrp label { font - weight : bold ; margin - left : 30 px ; width : 80 px ; clear : both ; padding : 0 10 px 0 0 ; line - height : 22 px ; _padding - top : 3 px ; float : left ; display : block ; font - size : 108 % ;}
2009-12-04 17:17:09 +00:00
. fieldgrp label span { font - weight : normal ;}
. fieldgrp label abbr { color : #4B911C; font-size:120%; vertical-align:middle;}
. field { float : left ; padding : 0 10 px 0 0 ; line - height : 22 px ; _padding - top : 3 px ;}
. field . longfield { width : 215 px ;}
. field . longfield - select { width : 220 px ;}
. field . smallfield { width : 95 px ;}
. field . medfield { width : 110 px ;}
. field span { display : block ; }
. field input , . field select { font - size : 110 % ; margin : 2 px 0 ; }
. field input [ type = " radio " ] { margin : 0 5 px 0 5 px ; border : 0 ; }
input [ type = " checkbox " ] { margin : 0 5 px 0 5 px ; border : 0 ; }
. submit { text - align : center ;}
2009-12-11 15:47:11 +00:00
< ? php
if ( ! isset ( $_REQUEST [ 'method' ]) || $_REQUEST [ 'method' ] != 'M' )
{
?>
2009-12-04 17:17:09 +00:00
#kbisM {display:none;}
2009-12-11 15:47:11 +00:00
< ? php
}
if ( ! isset ( $_REQUEST [ 'method' ]) || $_REQUEST [ 'method' ] != 'C' )
{
?>
2009-12-04 17:17:09 +00:00
#kbisC {display:none;}
2009-12-11 15:47:11 +00:00
< ? php
}
if ( empty ( $_REQUEST [ 'privileges' ][ 'type' ]))
{
?>
2009-12-04 17:17:09 +00:00
#privilegesM {display:none;}
2009-12-11 15:47:11 +00:00
< ? php
}
?>
2009-12-11 15:12:58 +00:00
#message {margin:10px 0 10px 30px;}
2009-12-04 17:17:09 +00:00
</ style >
< link rel = " stylesheet " type = " text/css " href = " ./css/reset.css " media = " screen " />
< link rel = " stylesheet " type = " text/css " href = " ./css/SimplyButtons.css " media = " screen " />
< script type = " text/javascript " src = " ./js/SimplyButtons.js " ></ script >
< script type = " text/javascript " >
$ ( document ) . ready ( function ()
{
$ ( 'input[type=radio][name=method]' ) . click ( function ()
{
var value = $ ( 'input[type=radio][name=method]:checked' ) . val ();
$ ( 'input[type=radio][name=method]' ) . each ( function (){
if ( $ ( this ) . val () != value ) { $ ( '#kbis' + $ ( this ) . val ()) . css ( 'display' , 'none' ); }
});
2009-12-11 16:10:03 +00:00
if ( value == 'T' ){ $ ( location ) . attr ( 'href' , './?page=kbis2&siret=<?=$siret?>' ); }
2009-12-04 17:17:09 +00:00
else if ( value == 'M' || value == 'C' ) {
2009-12-11 15:12:58 +00:00
if ( $ ( '#kbis' + value ) . css ( 'display' ) == 'none' ) $ ( '#kbis' + value ) . css ( 'display' , 'inline' );
2009-12-04 17:17:09 +00:00
}
});
2009-12-11 15:12:58 +00:00
$ ( 'input.type[type=checkbox]' ) . click ( function ()
2009-12-04 17:17:09 +00:00
{
var nbCheck = 0 ;
2009-12-11 15:12:58 +00:00
$ ( 'input.type[type=checkbox]:checked' ) . each ( function ()
2009-12-04 17:17:09 +00:00
{
nbCheck ++ ;
});
if ( nbCheck > 0 )
{
$ ( '#privilegesM' ) . css ( 'display' , 'block' );
} else {
$ ( '#privilegesM' ) . css ( 'display' , 'none' );
}
});
2009-12-11 15:12:58 +00:00
$ ( '.kbis' ) . click ( function (){
$ ( 'form[name=kbis]' ) . submit ();
});
$ ( '.privileges' ) . click ( function (){
$ ( 'form[name=privileges]' ) . submit ();
});
2009-12-04 17:17:09 +00:00
});
</ script >
< div id = " center " >
< h1 > COMMMANDES DE PI & Eacute ; CES </ h1 >
< table id = " identite " >
< tr >
< td width = " 200 " class = " StyleInfoLib " > Num & eacute ; ro identifiant Siren </ td >
2009-12-11 15:12:58 +00:00
< td class = " StyleInfoData " >< ? = substr ( $siret , 0 , 3 ) . ' ' . substr ( $siret , 3 , 3 ) . ' ' . substr ( $siret , 6 , 3 ) ?> </td>
2009-12-04 17:17:09 +00:00
</ tr >
< tr >
< td width = " 200 " class = " StyleInfoLib " > Raison Sociale </ td >
< td class = " StyleInfoData " >< ? = $_SESSION [ 'tabInfo' ][ 'entrep' ][ 'raisonSociale' ] ?> </td>
</ tr >
</ table >
2009-12-11 15:12:58 +00:00
< ? php
if ( ! empty ( $message ))
{
?>
< div id = " message " >
< ? = $message ?>
</ div >
< ? php
}
?>
2009-12-04 17:17:09 +00:00
< h2 > EXTRAIT KBIS </ h2 >
2009-12-23 10:20:29 +00:00
< ? php
if ( hasPerm ( 'kbis' )){
?>
2009-12-11 15:47:11 +00:00
< form name = " kbis " method = " post " action = " ./?page=pieces&siret=<?= $siret ?> " >
2009-12-11 15:12:58 +00:00
< input type = " hidden " name = " action " value = " kbis " />
2009-12-04 17:17:09 +00:00
< div class = " fieldgrp " >
< div class = " field " >
2009-12-11 15:47:11 +00:00
< input class = " noborder " type = " radio " name = " method " value = " T " < ? = $_REQUEST [ 'method' ] == 'T' ? 'checked' : '' ?> />Visualiser/T<> l<EFBFBD> charger le kbis<br/>
< input class = " noborder " type = " radio " name = " method " value = " M " < ? = $_REQUEST [ 'method' ] == 'M' ? 'checked' : '' ?> />Recevoir le kbis par email<br/>
< input class = " noborder " type = " radio " name = " method " value = " C " < ? = $_REQUEST [ 'method' ] == 'C' ? 'checked' : '' ?> />Recevoir le kbis original par courrier<br/>
2009-12-04 17:17:09 +00:00
</ div >
</ div >
2009-12-11 15:12:58 +00:00
< div id = " kbisM " >
< div class = " fieldgrp " >
2009-12-04 17:17:09 +00:00
< label > E - mail </ label >
< div class = " field " >
2009-12-11 15:12:58 +00:00
< input type = " text " class = " longfield " name = " email " value = " <?= $_SESSION['tabInfo'] ['email']?> " >
2009-12-04 17:17:09 +00:00
< span > Pr<EFBFBD> cisez votre e - mail pour recevoir le kbis .</ span >
</ div >
2009-12-11 15:12:58 +00:00
</ div >
2009-12-04 17:17:09 +00:00
2009-12-11 15:12:58 +00:00
< div class = " fieldgrp " >
< label > R<EFBFBD> f<EFBFBD> rence </ label >
< div class = " field " >
2009-12-11 15:47:11 +00:00
< input type = " text " class = " longfield " name = " ref " value = " <?= $_REQUEST['ref'] ?> " >
2009-12-11 15:12:58 +00:00
< span > Votre r<EFBFBD> f<EFBFBD> rence .</ span >
</ div >
</ div >
< div class = " fieldgrp " >
< label >& nbsp ; </ label >
< div class = " field " >< a href = " # " class = " button kbis " >< span >< span > Valider </ span ></ span ></ a ></ div >
</ div >
2009-12-04 17:17:09 +00:00
</ div >
< div id = " kbisC " >
< div class = " fieldgrp " >
< label > Societe </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< input class = " longfield " type = " text " name = " societe " value = " <?= $_REQUEST['societe'] ?> " /></ div >
2009-12-04 17:17:09 +00:00
</ div >
< div class = " fieldgrp " >
< label > Nom </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< input class = " longfield " type = " text " name = " nom " value = " <?= $_REQUEST['nom'] ?> " /></ div >
2009-12-04 17:17:09 +00:00
</ div >
< div class = " fieldgrp " >
< label > Prenom </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< input class = " longfield " type = " text " name = " prenom " value = " <?= $_REQUEST['prenom'] ?> " /></ div >
2009-12-04 17:17:09 +00:00
</ div >
< div class = " fieldgrp " >
< label > Adresse </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< input class = " longfield " type = " text " name = " adresse " value = " <?= $_REQUEST['adresse'] ?> " /></ div >
2009-12-04 17:17:09 +00:00
</ div >
< div class = " fieldgrp " >
< label > CP </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< input class = " longfield " type = " text " name = " cp " value = " <?= $_REQUEST['cp'] ?> " /></ div >
2009-12-04 17:17:09 +00:00
</ div >
< div class = " fieldgrp " >
< label > Ville </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< input class = " longfield " type = " text " name = " ville " value = " <?= $_REQUEST['ville'] ?> " /></ div >
2009-12-11 15:12:58 +00:00
</ div >
< div class = " fieldgrp " >
< label >& nbsp ; </ label >
< div class = " field " >< a href = " # " class = " button kbis " >< span >< span > Valider </ span ></ span ></ a ></ div >
2009-12-04 17:17:09 +00:00
</ div >
</ div >
2009-12-11 15:12:58 +00:00
</ form >
2009-12-23 10:20:29 +00:00
< ? php
} else {
?>
2009-12-23 16:31:21 +00:00
< p class = " marge " > Vous n 'avez pas les droits d' acc<EFBFBD> s pour cette fonctionalit<EFBFBD> .</ p >
2009-12-23 10:20:29 +00:00
< ? php
}
?>
2009-12-04 17:17:09 +00:00
< h2 > PRIVIL & Eacute ; GES & amp ; NANTISSEMENTS </ h2 >
2009-12-23 10:20:29 +00:00
< ? php
if ( hasPerm ( 'privileges' )){
?>
2009-12-11 15:47:11 +00:00
< form name = " privileges " method = " post " action = " ./?page=pieces&siret=<?= $siret ?> " >
2009-12-11 15:12:58 +00:00
< input type = " hidden " name = " action " value = " privileges " />
2009-12-04 17:17:09 +00:00
< div class = " fieldgrp " >
2009-12-11 15:47:11 +00:00
< input class = " noborder type " type = " checkbox " name = " privileges[type][] " value = " privSecu " < ? = is_array ( $_REQUEST [ 'privileges' ][ 'type' ]) && in_array ( 'privSecu' , $_REQUEST [ 'privileges' ][ 'type' ]) ? 'checked' : '' ?> />Privil<69> ges de la s<> curit<69> sociale et des r<> gimes compl<70> mentaires<br/>
< input class = " noborder type " type = " checkbox " name = " privileges[type][] " value = " privTres " < ? = is_array ( $_REQUEST [ 'privileges' ][ 'type' ]) && in_array ( 'privTres' , $_REQUEST [ 'privileges' ][ 'type' ]) ? 'checked' : '' ?> />Privil<69> ges du Tr<54> sor Public<br/>
< input class = " noborder type " type = " checkbox " name = " privileges[type][] " value = " nantFond " < ? = is_array ( $_REQUEST [ 'privileges' ][ 'type' ]) && in_array ( 'nantFond' , $_REQUEST [ 'privileges' ][ 'type' ]) ? 'checked' : '' ?> />Nantissements du fonds de commerce ou du fonds artisanal (conventionnels et judiciaires)<br/>
< input class = " noborder type " type = " checkbox " name = " privileges[type][] " value = " nantVend " < ? = is_array ( $_REQUEST [ 'privileges' ][ 'type' ]) && in_array ( 'nantVend' , $_REQUEST [ 'privileges' ][ 'type' ]) ? 'checked' : '' ?> />Privil<69> ges du vendeur de fonds de commerce et d'action r<> solutoire<br/>
< input class = " noborder type " type = " checkbox " name = " privileges[type][] " value = " declCrea " < ? = is_array ( $_REQUEST [ 'privileges' ][ 'type' ]) && in_array ( 'declCrea' , $_REQUEST [ 'privileges' ][ 'type' ]) ? 'checked' : '' ?> />D<> clarations de cr<63> ances<br/>
2009-12-04 17:17:09 +00:00
</ div >
2009-12-11 15:12:58 +00:00
< div id = " privilegesM " >
< div class = " fieldgrp " >
2009-12-04 17:17:09 +00:00
< label > E - mail </ label >
< div class = " field " >
2009-12-11 15:12:58 +00:00
< input type = " text " class = " longfield " name = " email " value = " <?= $_SESSION['tabInfo'] ['email']?> " >
2009-12-18 09:56:38 +00:00
< span > Pr<EFBFBD> cisez votre e - mail pour recevoir la commande .</ span >
2009-12-04 17:17:09 +00:00
</ div >
2009-12-11 15:12:58 +00:00
</ div >
2009-12-04 17:17:09 +00:00
2009-12-11 15:12:58 +00:00
< div class = " fieldgrp " >
< label > R<EFBFBD> f<EFBFBD> rence </ label >
< div class = " field " >
2009-12-11 15:47:11 +00:00
< input type = " text " class = " longfield " name = " ref " value = " <?= $_REQUEST['ref'] ?> " >
2009-12-11 15:12:58 +00:00
< span > Votre r<EFBFBD> f<EFBFBD> rence .</ span >
</ div >
</ div >
< div class = " fieldgrp " >
< label >& nbsp ; </ label >
2009-12-11 15:47:11 +00:00
< div class = " field " >< a href = " # " class = " button privileges " >< span >< span > Valider </ span ></ span ></ a ></ div >
2009-12-11 15:12:58 +00:00
</ div >
2009-12-04 17:17:09 +00:00
</ div >
</ form >
2009-12-23 10:20:29 +00:00
< ? php
} else {
?>
2009-12-23 16:31:21 +00:00
< p class = " marge " > Vous n 'avez pas les droits d' acc<EFBFBD> s pour cette fonctionalit<EFBFBD> .</ p >
2009-12-23 10:20:29 +00:00
< ? php
}
?>
2009-12-04 17:17:09 +00:00
</ div >