File: /home/artinside/sites.artinside.com.br/iande/themes/admin/widgets/services/service.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 -->
<?php if(!$services):?>
<img class="radius img-open" style="width: 20%; display: none;" src="<?= url("/storage/sistema/no-img.jpg") ?>" id="old-file"/>
<?php else: ?>
<img class="radius img-open" style="width: 20%; display: none" src="<?= image($services->cover, 400); ?>" id="old-file"/>
<?php endif; ?>
<!-- fim -->
<div class="mce_upload" style="z-index: 1001 !important;">
<div class="mce_upload_box">
<form class="app_form" action="<?= url("/admin/services/service"); ?>" 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 (!$services): ?>
<div class="row">
<div class="col-12 text-center my-4 text-sm-center">
<h3> Novo Serviço</h3>
<p>Crie um novo Serviço </p>
</div>
<div class="col-lg-9">
<section class="card">
<header class="card-header infinity-bg white-text">
Cadastrar Serviço
</header>
<div class="card-body">
<form class="form-horizontal tasi-form" method="post" action="<?= url("/admin/services/service"); ?>">
<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">
<!-- <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">
<!-- <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">
<div class="col-sm-12">
<label class="control-label">Mapa de Palavras*</label>
<input type="text" class="form-control" name="words" >
<span class="help-block">Separar as palavras por ; .</span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-sm-2 control-label">Conteúdo*</label>
<div class="col-sm-10">
<textarea name="content" 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-md-2 control-label">Data de publicação:</label>
<div class="col-md-4">
<input class="mask-datetime form-control" type="text" name="post_at" value="<?= date("d/m/Y H:i"); ?>"
required/>
<!-- <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-md-2 control-label">Categoria*</label>
<div class="col-md-4">
<select name="category" class="form-control" required>
<?php foreach ($categories as $category): ?>
<option value="<?= $category->id; ?>"><?= $category->title; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<button class="btn btn-primary" type="submit">Publicar</button>
<a class="btn btn-danger" href="<?= url("/admin/services/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 post [<?= $services->title; ?>] #<?= $services->id; ?> </h4>
<p><a class="icon-link btn btn-success" href="<?= url("/services/{$services->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 Serviços
</header>
<div class="card-body">
<form class="form-horizontal tasi-form" method="post" action="<?= url("/admin/services/service/{$services->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="<?= $services->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="<?= $services->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">Conteúdo*</label>
<div class="col-sm-10">
<textarea name="content" class="form-control mce"><?= $services->content; ?></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">
<div class="col-sm-12">
<label class="control-label">Mapa de Palavras*</label>
<input type="text" class="form-control" name="words" value="<?= $services->words; ?>" >
<span class="help-block">Separar as palavras por ; .</span>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label">Data de publicação:</label>
<div class="col-md-4">
<input class="mask-datetime form-control" type="text" name="post_at" value="<?= date_fmt($services->post_at, "d/m/Y H:i"); ?>"
required/>
<!-- <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-md-2 control-label">Categoria*</label>
<div class="col-md-4">
<select name="category" class="form-control" required>
<?php foreach ($categories as $category):
$categoryId = $services->category;
$select = function ($value) use ($categoryId) {
return ($categoryId == $value ? "selected" : "");
};
?>
<option <?= $select($category->id); ?>
value="<?= $category->id; ?>"><?= $category->title; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<button class="btn btn-primary" type="submit">Publicar</button>
<a class="btn btn-danger" href="<?= url("/admin/services/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($services->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(); ?>