from datetime import datetime
from django import forms
from BasicData.models import *


class CandidatAddForm(forms.Form):
    nom = forms.CharField(required=True)
    prenoms = forms.CharField(required=True)
    email = forms.EmailField(required=True)
    password = forms.CharField(required=True)
    password2 = forms.CharField(required=True)


class EtudiantEditForm(forms.ModelForm):
    class Meta:
        model = Etudiant
        fields = (
            'nom','nce','prenoms','sexe','datenaiss','lieunaiss','phone','email','matricule',
            'numero_bac','serie_bac','etablissement_bac','type_etablissement','annee_bac','mention_bac','centre_compo_bac',
            'nom_pere','nom_mere','contact_pere','contact_mere','contact_urgence','habitation_contact_urgence'
        )

        #exclude = ('actif','nc','is_staff','is_active')
        widgets = {
            # INFOS PERSO
            'nce': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;', 'placeholder':'Numéro Inscription'}),
            'nom': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;'}),
            'prenoms': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;'}),
            'sexe': forms.Select(attrs={'class': 'form-control','style': 'text-transform:uppercase;'}),
            'datenaiss': forms.NumberInput(attrs={'class': 'form-control','type': 'date'}),
            'lieunaiss': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;', 'placeholder':'Lieu de naissance'}),
            'phone': forms.TextInput(attrs={'class': 'form-control', 'placeholder':'Numéro de téléphone'}),
            'email': forms.TextInput(attrs={'class': 'form-control'}),
            # INFO BAC
            'matricule': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;', 'placeholder':'Matricule au Bac'}),
            'annee_bac': forms.TextInput(attrs={'class': 'form-control', 'type':'number', 'placeholder':"Année du Bac"}),
            'numero_bac': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;', 'placeholder':'Numéro de Table du Bac'}),
            'serie_bac': forms.Select(attrs={'class': 'form-control'}),
            'centre_compo_bac': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;', 'placeholder':'Centre de compsition du Bac'}),
            'etablissement_bac': forms.TextInput(attrs={'class': 'form-control','style': 'text-transform:uppercase;', "placeholder":"Lycée ou Collège d'origine"}),
            'type_etablissement': forms.Select(attrs={'class': 'form-control'}),
            'mention_bac': forms.Select(attrs={'class': 'form-control'}),
            # INFO TUTEUR
            'nom_pere': forms.TextInput(attrs={'class': 'form-control', 'style': 'text-transform:uppercase;', 'placeholder':'Nom du père'}),
            'nom_mere': forms.TextInput(attrs={'class': 'form-control', 'style': 'text-transform:uppercase;', 'placeholder':'Nom de la mère'}),
            'contact_pere': forms.TextInput(attrs={'class': 'form-control', 'style': 'text-transform:uppercase;', 'placeholder':'Numéro de téléphone du père'}),
            'contact_mere': forms.TextInput(attrs={'class': 'form-control', 'style': 'text-transform:uppercase;', 'placeholder':'Numéro de téléphone de la mère'}),
            'contact_urgence': forms.TextInput(attrs={'class': 'form-control', 'style': 'text-transform:uppercase;', 'placeholder':"téléhone en cas d'urgence"}),
            'habitation_contact_urgence': forms.TextInput(attrs={'class': 'form-control', 'style': 'text-transform:uppercase;', 'placeholder':"domicile de la personne à contacter"}),

        }


class PhotoAddForm(forms.ModelForm):
    class Meta:
        model = Etudiant
        fields = ('avatar',)
        widgets = {
            'avatar': forms.FileInput(attrs={'class': 'form-control', 'required':'required'}),
        }


class InscListFilterForm(forms.Form):
    ufr = forms.CharField()
    nce = forms.CharField()


class ReinscAgreeForm(forms.ModelForm):
    class Meta:
        model = NiveauEtudiant
        fields = ('niveau',)


class DocIdForm(forms.Form):
    doc = forms.CharField()


class DocIdForm2(forms.ModelForm):
    dem = forms.CharField()
    class Meta:
        model = ReponseDemandeActes
        fields = ('document',)


class PvArchForm(forms.Form):
    annee = forms.CharField()
    ufr = forms.CharField()
    niveau = forms.CharField()


class GenererForm(forms.Form):
    annee = forms.CharField()
    nce = forms.CharField()
    typedem = forms.CharField()

