PageSourceSearch

https://connect.inris-formations.com/_next/static/chunks/pages/manager/students/new-b82ef5df3b380f83.js

js inris-formations.com collected 2026-10-08 18:31:10 UTC 9,124 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7832],{71468:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manager/students/new",function(){return a(57752)}])},57752:function(e,s,a){"use strict";a.r(s),a.d(s,{__N_SSP:function(){return x},default:function(){return managerPlaning}});var l=a(85893),n=a(41664),i=a.n(n),r=a(9008),d=a.n(r),t=a(67294),c=a(47602),o=a(22920),m=a(11163),h=a.n(m);a(33299);var x=!0;function managerPlaning(e){let{user:s,agencies:a,purchases:n,activeAgency:r}=e,[m,x]=(0,t.useState)("profile"),[u,j]=(0,t.useState)("");async function handleImage(e){var s=new FileReader;s.onload=function(e){j(e.target.result)},s.readAsDataURL(e.target.files[0])}async function saveFormDatas(e){let a=$("form");a.find("[name=offerName]").val();let l=parseInt(a.find("[name=agencyId]").val()),n={role:"Etudiant",title:a.find("[name=title]").val(),firstname:a.find("[name=firstname]").val(),lastname:a.find("[name=lastname]").val(),image:e||"",address:a.find("[name=address]").val(),city:a.find("[name=city]").val(),username:a.find("[name=email]").val(),phone:a.find("[name=phone]").val(),postalCode:a.find("[name=postalCode]").val(),password:"12345",active:!0,Profile:{create:{type:"Etudiant",email:a.find("[name=email]").val()}},createdBy:s.id};l&&(n.Profile.create.agencyId=l);let i=await fetch("https://connect.inris-formations.com/api/students/0?action=create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),r=await i.json();if(200==i.status){if((0,o.Am)("Etudiant enregistr\xe9",{hideProgressBar:!1,autoClose:5e3,type:"success"}),l){var d={id:r.id,agency:{id:l}};fetch("/api/agencies/get?action=setAgency",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(e=>e.json()).then(e=>{})}h().push("/manager/students/".concat(r.id))}else{(0,o.Am)("Une erreur est survenue",{hideProgressBar:!1,autoClose:5e3,type:"error"});return}}async function onSubmitCreate(e){e.preventDefault();let s=e.currentTarget.image.files[0];if(!s){saveFormDatas(!1);return}let a=ref(storage,"files/".concat(s.name)),l=uploadBytesResumable(a,s);l.on("state_changed",e=>{e.bytesTransferred,e.totalBytes},e=>{alert(e)},()=>{getDownloadURL(l.snapshot.ref).then(e=>{saveFormDatas(e)})})}return(0,l.jsxs)(c.ZP,{chilData:{pagename:"students"},agencies:a,children:[(0,l.jsx)(d(),{children:(0,l.jsx)("title",{children:"Ajouter un \xe9l\xe8ve"})}),(0,l.jsxs)("div",{className:"content",children:[(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-md-12",children:(0,l.jsx)("div",{className:"card demo-icons",children:(0,l.jsxs)("div",{className:"card-header",children:[(0,l.jsx)("h6",{children:"INRI'S Formations"}),(0,l.jsx)("h5",{className:"card-title",children:"Ajouter un \xe9l\xe8ve"})]})})})}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-4",children:(0,l.jsx)("div",{className:"card add-agence-menu",children:(0,l.jsx)("ul",{className:"list-group ml-4 mt-4",children:(0,l.jsx)("li",{className:"pl-2 my-1 ".concat("profile"==m&&"active"),children:(0,l.jsx)(i(),{href:"#",onClick:e=>{x("profile")},children:"Informations de l'\xe9l\xe8ve"})})})})}),"profile"==m?(0,l.jsx)("div",{className:"col-md-8 add-produit-form",children:(0,l.jsxs)("form",{onSubmit:onSubmitCreate,children:[(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Civilit\xe9"}),(0,l.jsxs)("select",{defaultValue:null==s?void 0:s.title,name:"title",className:"form-control form-select",children:[(0,l.jsx)("option",{value:"",children:"Civilit\xe9"}),(0,l.jsx)("option",{value:"Monsieur",children:"Monsieur"}),(0,l.jsx)("option",{value:"Madame",children:"Madame"})]})]})}),(0,l.jsx)("div",{className:"col-md-6 d-flex align-items-center justify-content-center",children:(0,l.jsxs)("div",{className:"form-group w-100",style:{height:"8em"},children:[(0,l.jsxs)(i(),{className:"w-100 h-100 d-flex justify-content-center align-items-center",href:"#",onClick:function(){document.getElementById("image").click()},children:[(0,l.jsx)("img",{src:u,style:{zIndex:"1",maxWidth:"100%",maxHeight:"100%"}}),(0,l.jsxs)("div",{className:"position-absolute w-100 h-100 d-flex align-items-center justify-content-center",style:{left:"0",top:"0"},children:[(0,l.jsx)("i",{className:"fa-sharp fa-solid fa-plus mr-1"}),"Ajouter une photo"]})]}),(0,l.jsx)("input",{onChange:handleImage,accept:"image/*",name:"image",type:"file",id:"image",className:"d-none"})]})})]}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Nom"}),(0,l.jsx)("input",{name:"lastname",type:"text",className:"form-control",placeholder:"",required:!0})]})}),(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Pr\xe9noms"}),(0,l.jsx)("input",{name:"firstname",type:"text",className:"form-control",placeholder:"",required:!0})]})})]}),(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-md-12",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Mail"}),(0,l.jsx)("input",{name:"email",type:"text",className:"form-control",placeholder:"",required:!0})]})})}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"T\xe9l\xe9phone"}),(0,l.jsx)("input",{name:"phone",type:"text",className:"form-control",placeholder:"",required:!0})]})}),(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Code postal"}),(0,l.jsx)("input",{name:"postalCode",type:"text",className:"form-control",placeholder:""})]})})]}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Adresse"}),(0,l.jsx)("input",{name:"address",type:"text",className:"form-control",placeholder:""})]})}),(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Ville"}),(0,l.jsx)("input",{name:"city",type:"text",className:"form-control",placeholder:""})]})})]}),(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-md-12",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Agence"}),(0,l.jsxs)("select",{defaultValue:r,name:"agencyId",className:"form-control form-select",disabled:!0,children:[(0,l.jsx)("option",{value:!1,children:"..."}),null==a?void 0:a.map(function(e){return(0,l.jsx)("option",{value:e.id,children:e.name},e.id)})]})]})})}),(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsx)("div",{className:"form-group",children:(0,l.jsx)("button",{type:"submit",className:"btn-primary btn-round",style:{border:"none",padding:"10px 25px"},children:"Cr\xe9er un profil"})})})})]})}):null,"purchases"==m?(0,l.jsx)("div",{className:"col-md-8 add-produit-form",children:(0,l.jsxs)("table",{style:{width:"100%"},children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{style:{color:"#9AA6B7",fontWeight:"200"},children:[(0,l.jsx)("td",{children:"Nom de la prestation"}),(0,l.jsx)("td",{children:"Prix"}),(0,l.jsx)("td",{children:"Date"})]})}),(0,l.jsx)("tbody",{children:n.map(e=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:e.productName}),(0,l.jsx)("td",{children:e.amount}),(0,l.jsx)("td",{children:e.createdAt})]}))})]})}):null,"credentials"==m?(0,l.jsx)("div",{className:"col-md-8 add-produit-form",children:(0,l.jsxs)("form",{onSubmit:onSubmitCreate,children:[(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Mot de passe de la plateforme"}),(0,l.jsx)("input",{name:"password",type:"password",className:"form-control",placeholder:""})]})}),(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Identifiant de la plateforme"}),(0,l.jsx)("input",{name:"email",type:"text",className:"form-control",placeholder:""})]})})]}),(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsx)("div",{className:"form-group",children:(0,l.jsx)("button",{type:"submit",className:"btn-primary btn-round",style:{border:"none",padding:"10px 25px"},children:"R\xe9initialiser"})})})}),(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{children:"Mail associ\xe9 au profil"}),(0,l.jsx)("input",{name:"email",type:"email",className:"form-control",placeholder:""})]})})})]})}):null]})]})]})}}},function(e){e.O(0,[1664,5675,7602,9774,2888,179],function(){return e(e.s=71468)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.