const _0x61e113=_0x35a9;function _0xdc0b(){const _0x418a76=['json','381619MdohUg','status','/enregistrerQualification/:db/:id','post','utilisations','4100850jGLCMQ','1370450VmwuNk','5621888TRKwCY','send','6FOCNcS','\x0a\x20\x20\x20SELECT\x20*\x0a\x20\x20\x20FROM\x20Qualification;','Id_qualification\x20=\x20\x27','1152445OwKspp','express','params','recordset','DELETE\x20FROM\x20Qualification\x20WHERE\x20Id_qualification\x20=\x20\x27','513738AlBvjR','Suppression\x20avec\x20succès','estUtilise','/AjouterEtRenvoyerQualification/:db','exports','9lIqpaw','10LxsHBk','/qualifications/:db','\x0a\x20\x20\x20SELECT\x20*\x0a\x20\x20\x20FROM\x20Qualification\x0a\x20\x20\x20WHERE\x20Id_qualification\x20=\x20\x27','qualification','12XJzqmd','24739506JjZatV','Qualification'];_0xdc0b=function(){return _0x418a76;};return _0xdc0b();}(function(_0x2b7ba6,_0x4eca70){const _0xfb998e=_0x35a9,_0x35985c=_0x2b7ba6();while(!![]){try{const _0x165f89=parseInt(_0xfb998e(0x1f4))/0x1+parseInt(_0xfb998e(0x1f9))/0x2*(-parseInt(_0xfb998e(0x1fe))/0x3)+parseInt(_0xfb998e(0x1e4))/0x4*(-parseInt(_0xfb998e(0x1ee))/0x5)+-parseInt(_0xfb998e(0x1f1))/0x6*(-parseInt(_0xfb998e(0x1e8))/0x7)+-parseInt(_0xfb998e(0x1ef))/0x8+-parseInt(_0xfb998e(0x1ed))/0x9+-parseInt(_0xfb998e(0x1ff))/0xa*(-parseInt(_0xfb998e(0x1e5))/0xb);if(_0x165f89===_0x4eca70)break;else _0x35985c['push'](_0x35985c['shift']());}catch(_0x5a115c){_0x35985c['push'](_0x35985c['shift']());}}}(_0xdc0b,0xac0e9));function _0x35a9(_0x421144,_0x4d0f60){_0x421144=_0x421144-0x1e1;const _0xdc0b4c=_0xdc0b();let _0x35a96c=_0xdc0b4c[_0x421144];return _0x35a96c;}const express=require(_0x61e113(0x1f5)),router=express['Router'](),{verifierUtilisation,genererMessageErreur}=require('../commun/verificationUtilisation');router[_0x61e113(0x1eb)](_0x61e113(0x1e1),verifyToken,Context,async(_0x533ddd,_0x58fbf1)=>{const _0x58f4d2=_0x61e113;let _0x11de5c;try{_0x11de5c=_0x58f4d2(0x1f2);const _0x29e87e=await executeQuery(_0x533ddd['params']['db'],_0x11de5c);_0x58fbf1['json'](_0x29e87e[_0x58f4d2(0x1f7)]);}catch(_0x59a989){traiterErreur(_0x11de5c,_0x59a989,_0x58fbf1,__filename,_0x533ddd[_0x58f4d2(0x1f6)]['db']);}}),router[_0x61e113(0x1eb)]('/unqualification/:db/:id',verifyToken,Context,async(_0x3ff9c0,_0x102f2c)=>{const _0x5c71ba=_0x61e113;let _0x2db0e1;try{_0x2db0e1=_0x5c71ba(0x1e2)+_0x3ff9c0[_0x5c71ba(0x1f6)]['id']+'\x27;';const _0x30af34=await executeQuery(_0x3ff9c0[_0x5c71ba(0x1f6)]['db'],_0x2db0e1);_0x102f2c['json'](_0x30af34['recordset'][0x0]);}catch(_0x37cd5d){traiterErreur(_0x2db0e1,_0x37cd5d,_0x102f2c,__filename,_0x3ff9c0[_0x5c71ba(0x1f6)]['db']);}}),router[_0x61e113(0x1eb)](_0x61e113(0x1fc),verifyToken,Context,async(_0x1db4c8,_0x5f0b8b)=>{const _0x8e17c1=_0x61e113;let _0x303f44;try{_0x303f44='\x0a\x20\x20\x20DECLARE\x20@id\x20INT;\x0a\x20\x20\x20\x0a\x20\x20\x20SELECT\x20@id\x20=\x20ISNULL(MAX(Id_qualification),\x200)\x20+\x201\x0a\x20\x20\x20FROM\x20Qualification\x20\x0a\x20\x20\x20WHERE\x20IsNumeric(Id_qualification)\x20=\x201;\x0a\x0a\x20\x20\x20INSERT\x20INTO\x20Qualification\x20(Id_qualification)\x0a\x20\x20\x20VALUES\x20(@id);\x0a\x0a\x20\x20\x20SELECT\x20TOP\x201\x20*\x0a\x20\x20\x20FROM\x20Qualification\x0a\x20\x20\x20WHERE\x20Id_qualification\x20=\x20@id;';const _0x4d4e23=await executeQuery(_0x1db4c8[_0x8e17c1(0x1f6)]['db'],_0x303f44);_0x5f0b8b[_0x8e17c1(0x1e9)](0xc9)[_0x8e17c1(0x1e7)](_0x4d4e23['recordset'][0x0]);}catch(_0x333545){traiterErreur(_0x303f44,_0x333545,_0x5f0b8b,__filename,_0x1db4c8[_0x8e17c1(0x1f6)]['db']);}}),router['post'](_0x61e113(0x1ea),verifyToken,Context,async(_0x5cec78,_0x3fa988)=>{const _0xaa0290=_0x61e113;let _0x2a5f56,_0x5d2dec={..._0x5cec78['body']};try{_0x2a5f56=construireRequeteMiseAJour(_0xaa0290(0x1e6),_0x5d2dec,_0xaa0290(0x1f3)+_0x5cec78['params']['id']+'\x27','Id_qualification'),await executeQuery(_0x5cec78['params']['db'],_0x2a5f56),_0x3fa988['status'](0xc9)[_0xaa0290(0x1e7)]({'message':'Mise\x20à\x20jour\x20avec\x20succès'});}catch(_0x21742c){traiterErreur(_0x2a5f56,_0x21742c,_0x3fa988,__filename,_0x5cec78['params']['db']);}}),router['post']('/supprimerQualification/:db/:id',verifyToken,Context,async(_0x3ede67,_0xc79206)=>{const _0x21ec20=_0x61e113;let _0x163191;try{const _0x3b67b4=_0x3ede67['params']['id'],_0x9aae95=await verifierUtilisation(_0x3ede67[_0x21ec20(0x1f6)]['db'],_0x21ec20(0x1e3),_0x3b67b4);if(_0x9aae95[_0x21ec20(0x1fb)])return _0xc79206[_0x21ec20(0x1e9)](0x190)[_0x21ec20(0x1e7)]({'message':genererMessageErreur(_0x21ec20(0x1e3),_0x9aae95[_0x21ec20(0x1ec)])});_0x163191=_0x21ec20(0x1f8)+_0x3b67b4+'\x27',await executeQuery(_0x3ede67['params']['db'],_0x163191),_0xc79206['status'](0xc8)[_0x21ec20(0x1f0)](_0x21ec20(0x1fa));}catch(_0x3d2e2e){traiterErreur(_0x163191,_0x3d2e2e,_0xc79206,__filename,_0x3ede67['params']['db']);}}),module[_0x61e113(0x1fd)]=router;