Example #1
0
include_once dirname(__FILE__) . '/../model/TipoTrabalho.class.php';
include_once dirname(__FILE__) . '/../model/Area.class.php';
include_once dirname(__FILE__) . '/../model/Subarea.class.php';
include_once dirname(__FILE__) . '/../model/Participante.class.php';
include_once dirname(__FILE__) . '/../inc/helper.inc.php';
if (!recebendo_submissao_trabalhos()) {
    header("location: /" . $config['PATH'] . "/index.php?syserror=SUBMISSAO_TRABALHOS_ENCERRADA");
    exit;
}
session_start();
if (!isset($_SESSION['participante'])) {
    header("location: /" . $config['PATH'] . "/trabalhos/form_login.php?info=INSCRICAO_SUBMISSAO");
    exit;
}
$participante = $_SESSION['participante'];
$tipos = TipoTrabalho::all();
$areas = Area::all();
?>

<!DOCTYPE HTML>
<html lang="pt-br">
	<head>
		<?php 
include_once dirname(__FILE__) . '/../inc/head.inc.php';
?>
		<script type="text/javascript">
			jQuery(function($){
				$(".help-inline").hide();
				
				<?php 
if (isset($_GET['error'])) {
Example #2
0
 public static function convert($row)
 {
     $trabalho = new Trabalho();
     $trabalho->id = $row['id'];
     $trabalho->titulo = $row['titulo'];
     $trabalho->resumo = $row['resumo'];
     $trabalho->palavras_chave = $row['palavras_chave'];
     $trabalho->subarea = Subarea::find($row['subarea_id']);
     $trabalho->tipo = TipoTrabalho::find($row['tipo_id']);
     $trabalho->extensao = $row['extensao'];
     $trabalho->autor_principal = Participante::find($row['autor_principal_id']);
     return $trabalho;
 }
Example #3
0
}
session_start();
if (!isset($_SESSION['participante'])) {
    header("location: /" . $config['PATH'] . "/trabalhos/form_login.php?syserror=INSCRICAO_SUBMISSAO");
    exit;
}
if (!in_array(get_file_extension($_FILES['arquivo']['name']), $config['PAPER_TYPES'])) {
    header("location: /" . $config['PATH'] . "/trabalhos/form_submissao.php?syserror=FORMATO_SUBMISSAO_INVALIDO");
    exit;
}
$trabalho = new Trabalho();
$trabalho->titulo = $_POST['titulo'];
$trabalho->resumo = $_POST['resumo'];
$trabalho->palavras_chave = $_POST['palavras_chave'];
$trabalho->subarea = Subarea::find($_POST['subarea_id']);
$trabalho->tipo = TipoTrabalho::find($_POST['tipo_id']);
$trabalho->extensao = get_file_extension($_FILES['arquivo']['name']);
$trabalho->autor_principal = $_SESSION['participante'];
$trabalho->save();
if (is_uploaded_file($_FILES['arquivo']['tmp_name'])) {
    $result = move_uploaded_file($_FILES['arquivo']['tmp_name'], dirname(__FILE__) . '/uploads/' . $trabalho->id . '.' . get_file_extension($_FILES['arquivo']['name']));
    if (!$result) {
        echo "Falha ao mover o arquivo!";
    }
} else {
    echo "Operação não permitida!";
}
if (isset($_POST['nomes_coautores'])) {
    $quantidade_coautores = count($_POST['nomes_coautores']);
    for ($i = 0; $i < $quantidade_coautores; $i++) {
        $coautor = new Coautor();