|
Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/angkasapuraretail.com/public_html/application/views/admin/highlights/ |
Upload File : |
<div class="row">
<div class="col-sm-12">
<a href="<?= base_url('admin/highlights'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to highlights List Page</a><br><br>
<h4><?= empty($highlights->id) ? 'Add a new highlights' : 'Edit highlights: '
. $highlights->title; ?></h4>
<?= $this->session->flashdata('success'); //to display success message ?>
<?= $this->session->flashdata('result'); //to display result message ?>
</div>
</div>
<?= form_open_multipart(); ?>
<div class="row">
<div class="col-sm-3">
<p>Highlights Title</p>
</div>
<div class="col-sm-9">
<p>
<?php
$data = array(
'name' => 'highlights_name',
'value' => $highlights->title,
'class' => 'form-control'
);
echo form_input($data); ?>
<?= form_error('highlights_name'); ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<p>Publish Date</p>
</div>
<div class="col-sm-9">
<p>
<?php
//get highlights pulish date from database, convert to dd-mm-yy format
if(!empty($highlights->publish_date)) {
$publish_date = date('d-m-Y', strtotime($highlights->publish_date));
} else {
$publish_date = '';
}
$data = array(
'name' => 'publish_date',
'value' => $publish_date,
'class' => 'form-control datepicker'
);
echo form_input($data); ?>
<?= form_error('publish_date'); ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<p>Image Banner<br>
<?php if (!empty($highlights->image2)) : ?>
<img style="width:100px; height:auto;" src="<?= base_url() . 'uploads/highlights/' . $highlights->image2; ?>" alt="" />
<i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/highlights/delete_image/' . $highlights->id . '/image2'; ?>">Delete</a>
<?php endif; ?>
</p>
</div>
<div class="col-sm-9">
<p><input type="file" name="image2" size="20" class="form-control" /><br>
<?php
//get max image width and height from configuration table
$this->db->select('highlights_image_width, highlights_image_height, highlights_thumbnail_width, highlights_thumbnail_height')->from('configuration')->where('id_configuration', 1);
$image_dimension = $this->db->get()->row();
?>
<span style="font-size:12px; font-style: italic;">Image size must be max of <?= $image_dimension->highlights_image_width;?> pixel width. <?= $image_dimension->highlights_image_height;?> pixel height, jpg/jpeg/gif/png/webp, max 1MB</span><br>
<span style="color:#F7931E;"><?php echo form_error('image2'); ?></span>
<?php echo $this->session->flashdata('image2-error'); //to display error message ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<p>Image Thumbnail<br>
<?php if (!empty($highlights->image1)) : ?>
<img style="width:100px; height:auto;" src="<?= base_url() . 'uploads/highlights/' . $highlights->image1; ?>" alt="" />
<i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/highlights/delete_image/' . $highlights->id . '/image1'; ?>">Delete</a>
<?php endif; ?>
</p>
</div>
<div class="col-sm-9">
<p><input type="file" name="image1" size="20" class="form-control" /><br>
<span style="font-size:12px; font-style: italic;">Image size must be max of <?= $image_dimension->highlights_thumbnail_width;?> pixel width. <?= $image_dimension->highlights_thumbnail_height;?> pixel height, jpg/jpeg/gif/png/webp, max 1MB</span><br>
<span style="color:#F7931E;"><?php echo form_error('image1'); ?></span>
<?php echo $this->session->flashdata('image1-error'); //to display error message ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<p>Highlights Content</p>
</div>
<div class="col-sm-9">
<?php echo form_textarea('description', set_value('description', $highlights->description, FALSE)); ?>
<?php echo form_error('description'); ?>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<p>Display</p>
</div>
<div class="col-sm-9">
<?php
$options = array(
0 => 'No (Save as Draft)',
1 => 'Yes (Live)'
);
echo form_dropdown('status', $options, $highlights->status, 'class="form-control"');
?>
</div>
</div>
<div class="row">
<div class="col-sm-3">
</div>
<div class="col-sm-9">
<?php if($allowed == true) : ?>
<?= form_submit('submit', 'Save', 'class="btn btn-primary btn-success button-brown"'); ?> <?= anchor('admin/highlights', 'cancel'); ?>
<?php endif; ?>
</div>
</div>
<?= form_close(); ?>