Exemplo n.º 1
0
def personal_register():
    form = PersonalRegister()
    if not session.get('is_aunthenticate'):
        return redirect('/')
    if form.validate_on_submit():
        cursor = mysql.connection.cursor()
        _sql_response = cursor.execute(
            "SELECT id FROM persona WHERE cedula = %s", [
                form.cedula.data,
            ])
        if _sql_response:
            flash('Ya existe un personal con con la cedula ' +
                  str(form.cedula.data))
        else:
            cam = PyCam(False)
            cam.record_face(form.nombre.data, form.apellido.data,
                            form.cedula.data, 2, "", "", form.sueldo.data, 0)
            flash("Personal agregado")
            del cam
            return redirect(url_for('personal_register'))
    return render_template('personal_register.html', form=form)
Exemplo n.º 2
0
def student_register():
    form = StudentRegister()
    if not session.get('is_aunthenticate'):
        return redirect('/')
    if form.validate_on_submit():
        cursor = mysql.connection.cursor()
        _sql_response = cursor.execute(
            "SELECT id FROM persona WHERE cedula = %s", [
                form.cedula.data,
            ])
        if _sql_response:
            flash('Ya existe un estudiante con la cedula ' +
                  str(form.cedula.data))
        else:
            cam = PyCam(False)
            cam.record_face(str(form.nombre.data), str(form.apellido.data),
                            str(form.cedula.data),
                            0, _carrera[form.carrera.data],
                            str(form.semestre.data))
            flash('Estudiante registrado')
            del cam
            return redirect(url_for('student_register'))
    return render_template('student_register.html', form=form)
Exemplo n.º 3
0
from pycam.pycam import PyCam
import cv2

cam = PyCam(False)

#cam.record_face("Victor","Mendoza","21476548",0,"Ingenieria Electronica","10mo")

#cam.record_face("Gabriel","Falcon","124874121",0,"Ingenieria en Telecomunicaciones","10mo")

#cam.record_face("Sabastian","Dinapoli","32384203",1,"","",0,5000.0)

#cam.record_face("Valentina","Dinapoli","36475890",2,"","",5000.0,0)

#cam.record_face("Carlos","Henriquez","26186774",0,"Ingenieria Electronica","10mo")

cam.record_face("Daniel", "Zambrano", "267755474", 0, "Ingenieria Electronica",
                "10mo")