File: /home/artinside/sites.artinside.com.br/paliar/themes/admin/widgets/courses/course.php
<?php $this->layout("_admin"); ?>
<?php $this->start("css") ?>
<link rel="stylesheet" type="text/css" href="<?= url("admin-assets/css/gallery.css"); ?>"/>
<?php $this->end(); ?>
<!-- importante para reposiçao de imagens que ultrapassam limite -->
<img class="radius img-open" style="width: 20%; display: none" src="<?= image($courses->cover, 400); ?>"
id="old-file"/>
<!-- fim -->
<div class="mce_upload" style="z-index: 1001 !important;">
<div class="mce_upload_box">
<form class="app_form" action="<?= url("/admin/courses/course"); ?>" method="post"
enctype="multipart/form-data">
<input type="hidden" name="upload" value="true"/>
<label>
<label class="legend">Selecione uma imagem JPG ou PNG:</label>
<input accept="image/*" type="file" name="image" required class="form-control"/>
</label>
<button class="btn btn-danger icon-upload">Enviar Imagem</button>
</form>
</div>
</div>
<section class="wrapper">
<?php if (!$courses): ?>
<div class="row">
<div class="col-12 text-center my-4 text-sm-center">
<h3> Novo Curso</h3>
<p>Crie um novo curso </p>
</div>
<div class="col-lg-9">
<section class="card">
<header class="card-header infinity-bg white-text">
Cadastrar Curso
</header>
<div class="card-body">
<form class="form-horizontal tasi-form" method="post"
action="<?= url("/admin/courses/course"); ?>">
<input type="hidden" name="action" value="create"/>
<div class="form-group row" hidden>
<label class="col-sm-2 col-sm-2 control-label">Capa (1920x1080px)</label>
<div class="col-sm-10">
<input type="file" name="cover" placeholder="Uma imagem de capa"
class="form-control" id="j_img_preview"/>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Título*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="title" value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Subtítulo*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="subtitle" value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Carga*</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="workload">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Valor Total*</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="price">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Desc. a vista*</label>
<div class="col-sm-2">
<input type="text" class="form-control mask-value" name="discount">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Máx. Parcelas*</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="max_installment">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Início do Curso*</label>
<div class="col-sm-2">
<input type="text" class="form-control mask-date" name="class_start"
value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Inscrições até*</label>
<div class="col-sm-2">
<input type="text" class="form-control mask-date" name="limit_enrolment"
value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Dias da Semana*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="date" value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Horários*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="time" value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Duração*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="duration" value="">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Video</label>
<div class="col-sm-12">
<textarea name="video" class="form-control"></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Apresentação*</label>
<div class="col-sm-12">
<textarea name="about" class="form-control mce"></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Para quem (Área de atuação)*</label>
<div class="col-sm-12">
<textarea name="area" class="form-control mce"></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Perfil do Egresso*</label>
<div class="col-sm-12">
<textarea name="requirements" class="form-control mce"></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Metodologia*</label>
<div class="col-sm-12">
<textarea name="diferentials" class="form-control mce"></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">O que vai aprender (Programação)</label>
<div class="col-sm-12">
<textarea name="grade" class="form-control mce"></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<!-- <div class="form-group row">-->
<!-- <label class="col-sm-2 col-sm-2 control-label">Metodologia</label>-->
<!-- <div class="col-sm-12">-->
<!-- <textarea name="metodology" class="form-control mce"></textarea>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label ">Aspas*</label>
<div class="col-sm-12">
<textarea name="aspas" class="form-control mce"></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Coordenador</label>
<div class="col-sm-12">
<input type="text" class="form-control" name="coordenador" value="">
<!-- <span class="help-block">Só usar em caso de necessidade de tabelas de preços, não será integrado ou não mostrará na matrícula o valor do curso e parcelamento.</span>-->
</div>
</div>
<!---->
<!-- <div class="form-group row">-->
<!-- <label class="col-sm-2 col-sm-2 control-label">Objetivo*</label>-->
<!-- <div class="col-sm-12">-->
<!-- <textarea name="objective" class="form-control mce"></textarea>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group row">
<label class="col-md-2 control-label">Status*</label>
<div class="col-md-4">
<select name="status" class="form-control" required>
<option value="1">Publicar</option>
<option value="0">Rascunho</option>
</select>
</div>
<label class="col-md-2 control-label">Permitir Matrícula*</label>
<div class="col-md-4">
<select name="enrollment" class="form-control" required>
<option value="0">Indisponível</option>
<option value="1">Matrículas Abertas</option>
</select>
</div>
</div>
<button class="btn btn-primary" type="submit">Publicar</button>
<a class="btn btn-danger" href="<?= url("/admin/courses/home"); ?>">Cancelar</a>
</form>
</div>
</section>
</div>
<div class="col-lg-3">
<section class="card">
<header class="card-header infinity-bg white-text text-center">
Imagem de capa
</header>
<img class="radius img-open" style="width: 100%;" src="<?= url("/storage/sistema/no-img.jpg") ?>" id="image-preview"/>
</section>
</div>
</div>
<?php else: ?>
<div class="row">
<div class="col-12 text-center my-4 text-sm-center">
<h4> Editar curso [<?= $courses->title; ?>] #<?= $courses->id; ?> </h4>
<p><a class="icon-link btn btn-success" href="<?= url("/cursos/{$courses->uri}"); ?>"
target="_blank"
title="">Ver no
site</a></p>
</div>
<div class="col-lg-9">
<section class="card">
<header class="card-header infinity-bg white-text">
Editar Cursos
</header>
<div class="card-body">
<form class="form-horizontal tasi-form" method="post"
action="<?= url("/admin/courses/course/{$courses->id}"); ?>">
<input type="hidden" name="action" value="update"/>
<div class="form-group row" hidden>
<label class="col-sm-2 col-sm-2 control-label">Capa (1920x1080px)</label>
<div class="col-sm-10">
<input type="file" name="cover" placeholder="Uma imagem de capa"
class="form-control" id="j_img_preview"/>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Título*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="title"
value="<?= $courses->title; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Subtítulo*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="subtitle"
value="<?= $courses->subtitle; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Carga*</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="workload"
value="<?= $courses->workload; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Valor Total*</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="price"
value="<?= $courses->price; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Desc. a vista*</label>
<div class="col-sm-2">
<input type="text" class="form-control mask-value" name="discount"
value="<?= $courses->discount; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Máx. Parcelas*</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="max_installment"
value="<?= $courses->max_installment; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Início do Curso*</label>
<div class="col-sm-2">
<input type="text" class="form-control mask-date" name="class_start"
value="<?= date_fmt($courses->class_start, "d/m/Y"); ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
<label class="col-sm-2 col-sm-2 control-label">Inscrições até*</label>
<div class="col-sm-2">
<input type="text" class="form-control mask-date" name="limit_enrolment"
value="<?= date_fmt($courses->limit_enrolment, "d/m/Y"); ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Dias da Semana*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="date" value="<?= $courses->date; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Horários*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="time" value="<?= $courses->time; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Duração*</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="duration" value="<?= $courses->duration; ?>">
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Video</label>
<div class="col-sm-12">
<textarea name="video" class="form-control"><?= $courses->video; ?></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Apresentação*</label>
<div class="col-sm-12">
<textarea name="about"
class="form-control mce"><?= $courses->about; ?></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Para quem (Área de atuação)*</label>
<div class="col-sm-12">
<textarea name="area" class="form-control mce"><?= $courses->area; ?></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Perfil do Egresso*</label>
<div class="col-sm-12">
<textarea name="requirements"
class="form-control mce"><?= $courses->requirements; ?></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">Metodologia*</label>
<div class="col-sm-12">
<textarea name="diferentials"
class="form-control mce"><?= $courses->diferentials; ?></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-12 control-label">O que vai aprender (Programação)</label>
<div class="col-sm-12">
<textarea name="grade"
class="form-control mce"><?= $courses->grade; ?></textarea>
<!-- <span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>-->
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label ">Aspas*</label>
<div class="col-sm-12">
<textarea name="aspas" class="form-control"><?= $courses->aspas; ?></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Coordenador</label>
<div class="col-sm-12">
<input type="text" class="form-control" name="coordenador" value="<?= $courses->coordenador; ?>">
<!-- <span class="help-block">Só usar em caso de necessidade de tabelas de preços, não será integrado ou não mostrará na matrícula o valor do curso e parcelamento.</span>-->
</div>
</div>
<!-- <div class="form-group row">-->
<!-- <label class="col-sm-2 col-sm-2 control-label">Metodologia</label>-->
<!-- <div class="col-sm-12">-->
<!-- <textarea name="metodology"-->
<!-- class="form-control mce">--><?php //= $courses->metodology; ?><!--</textarea>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group row">-->
<!-- <label class="col-sm-2 col-sm-2 control-label">Local e Horário*</label>-->
<!-- <div class="col-sm-12">-->
<!-- <textarea name="period"-->
<!-- class="form-control mce">--><?php //= $courses->period; ?><!--</textarea>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group row">-->
<!-- <label class="col-sm-2 col-sm-2 control-label">Preço Especial</label>-->
<!-- <div class="col-sm-12">-->
<!-- <textarea name="special_price"-->
<!-- class="form-control mce">--><?php //= $courses->special_price; ?><!--</textarea>-->
<!-- <span class="help-block">Só usar em caso de necessidade de tabelas de preços, não será integrado ou não mostrará na matrícula o valor do curso e parcelamento.</span>-->
<!-- </div>-->
<!-- </div>-->
<!---->
<!---->
<!-- <div class="form-group row">-->
<!-- <label class="col-sm-2 col-sm-2 control-label">Objetivo*</label>-->
<!-- <div class="col-sm-12">-->
<!-- <textarea name="objective"-->
<!-- class="form-control mce ">--><?php //= $courses->objective; ?><!--</textarea>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group row">
<label class="col-md-2 control-label">Status*</label>
<div class="col-md-4">
<select name="status" class="form-control" required>
<?php
$status = $courses->status;
$select = function ($value) use ($status) {
return ($status == $value ? "selected" : "");
};
?>
<option <?= $select(1); ?> value="1">Publicar</option>
<option <?= $select(0); ?> value="0">Rascunho</option>
</select>
</div>
<label class="col-md-2 control-label">Permitir Matrícula*</label>
<div class="col-md-4">
<select name="enrolment" class="form-control" required>
<?php
$status = $courses->enrolment;
$select = function ($value) use ($status) {
return ($status == $value ? "selected" : "");
};
?>
<option <?= $select(1); ?> value="1">Matrículas Abertas</option>
<option <?= $select(0); ?> value="0">Indisponível</option>
</select>
</div>
</div>
<!-- <div class="form-group row">-->
<!-- <label class="col-12 control-label font-weight-bolder font-medium2 py-2"> Selecione-->
<!-- abaixo os documentos para o curso</label>-->
<!---->
<!-- --><?php
// $docArray = [];
// if ($cDoc) {
// foreach ($cDoc as $c) {
// array_push($docArray, $c->document_id);
// }
// }
// foreach ($documents as $doc):
// ?>
<!-- <div class="col-lg-4 col-md-6 ">-->
<!-- <div class="infinity-checkbox">-->
<!-- <input id="check---><?php //= $doc->id ?><!--" class="infinity-radio"-->
<!-- name="documents[]" type="checkbox"-->
<!-- value="--><?php //= $doc->id ?><!--" --><?php //= in_array($doc->id, $docArray) ? "checked" : "" ?>
<!-- <label for="check---><?php //= $doc->id ?><!--" class="infinity-radio"-->
<!-- style="width: 100%; text-align: left !important;"><span-->
<!-- class="font-weight-bolder">--><?php //= $doc->title ?><!--</span>-->
<!-- </label>-->
<!-- </div>-->
<!-- </div>-->
<!-- --><?php //endforeach; ?>
<!-- </div>-->
<button class="btn btn-primary" type="submit">Publicar</button>
<a class="btn btn-danger" href="<?= url("/admin/courses/home"); ?>">Cancelar</a>
</form>
</div>
</section>
</div>
<div class="col-lg-3">
<section class="card">
<header class="card-header infinity-bg white-text text-center">
Imagem de capa
</header>
<img class="radius img-open" style="width: 100%;" src="<?= image($courses->cover, 400); ?>" id="image-preview"/>
</section>
</div>
</div>
<?php endif; ?>
</section>
<?php $this->start("scripts") ?>
<script src="<?= url("admin-assets/js/toucheffects.js") ?>"></script>
<script src="<?= url("admin-assets/js/modernizr.custom.js") ?>"></script>
<?php $this->end(); ?>