PHP File Manager
Editing File: edit.php
<form method="post" action=""> <?php if (isset($news->news_id)): ?> <input type="hidden" name="news_id" value="<?php echo $news->news_id; ?>"> <?php endif; ?> <div id="top-right-buttons" class="btn-group pull-right"> <button type="submit" name="submit_type" value="save" class="btn btn-primary"> Save </button> <button type="submit" name="submit_type" value="save_and_edit" class="btn btn-default"> Save and edit </button> <?php if (isset($news->news_id)): ?> <button type="submit" name="submit_type" value="delete" class="btn btn-danger"> Delete </button> <?php endif; ?> </div> <div class="row"> <div class="col-sm-6"> <h2>Details</h2> <div class="row"> <div class="col-sm-6 form-group"> <label for="title" class="control-label">Title</label> <input type="text" name="title" value="<?php echo $this->input->post('title') ? $this->input->post('title') : isset($news->title) ? $news->title : ''; ?>" id="title" class="form-control"> </div> <div class="col-sm-6 form-group"> <label for="alias" class="control-label">Alias</label> <input type="text" name="alias" value="<?php echo $this->input->post('alias') ? $this->input->post('alias') : isset($news->alias) ? $news->alias : ''; ?>" id="alias" class="form-control" placeholder="Leave blank to automatically generate"> </div> </div> <div class="row"> <div class="col-sm-6 form-group"> <label for="published" class="control-label">Publish at</label> <input type="text" name="published" value="<?php echo $this->input->post('published') ? $this->input->post('published') : isset($news->published) ? date('d/m/Y H:i', strtotime($news->published)) : date('d/m/Y H:i'); ?>" id="published" class="form-control date_mask"> </div> <div class="col-sm-6 form-group"> <label for="categories" class="control-label">Shown on pages</label> <?php echo $this->news->categoriesDropdown('categories[]', $this->news->getCategories(), (isset($news->news_id) ? $this->news->getCategories(null, $news->news_id) : array())); ?> </div> </div> <div class="form-group"> <label for="summary" class="control-label">Summary</label> <textarea name="summary" id="summary" class="form-control ckeditor"><?php echo $this->input->post('summary') ? $this->input->post('summary') : isset($news->summary) ? $news->summary: ''; ?></textarea> </div> <div class="form-group"> <label for="body" class="control-label">Body</label> <textarea name="body" id="body" class="form-control ckeditor"><?php echo $this->input->post('body') ? $this->input->post('body') : isset($news->body) ? $news->body: ''; ?></textarea> </div> </div> <div class="col-sm-6"> <h2>Match info</h2> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-sm-6"> <div class="form-group"> <label for="match_date" class="control-label">Kickoff date and time</label> <input type="text" name="match_date" value="<?php echo isset($news->match_date) ? date('d/m/Y H:i', strtotime($news->match_date)) : ''; ?>" id="match_date" class="form-control datepick_kickoff"> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="match_location_id" class="control-label">Location</label> <?php echo form_dropdown('match_location_id', $locations_selection, (isset($news->match_location_id) ? $news->match_location_id : null), 'id="match_location_id" class="form-control enhanced"'); ?> </div> </div> </div> <div class="row"> <div class="col-sm-5 text-right"> <h3>Team 1</h3> <div class="form-group"> <?php echo form_dropdown('match_team_1_id', $teams_selection, (isset($news->match_team_1_id) ? $news->match_team_1_id : null), array('class' => 'form-control enhanced', 'id' => 'team_1')); ?> </div> <div class="row"> <div class="form-group col-sm-5 col-sm-offset-7"> <label for="match_team_1_score" class="control-label">Score</label> <input type="number" name="match_team_1_score" min="0" id="match_team_1_score" class="form-control" value="<?php echo isset($news->match_team_1_score) ? $news->match_team_1_score : ''; ?>"> </div> </div> </div> <div class="col-sm-2 text-center h1"> VS </div> <div class="col-sm-5"> <h3>Team 2</h3> <div class="form-group"> <?php echo form_dropdown('match_team_2_id', $teams_selection, (isset($news->match_team_2_id) ? $news->match_team_2_id : null), array('class' => 'form-control enhanced', 'id' => 'team_2')); ?> </div> <div class="row"> <div class="form-group col-sm-5"> <label for="match_team_2_score" class="control-label">Score</label> <input type="number" name="match_team_2_score" min="0" id="match_team_2_score" class="form-control" value="<?php echo isset($news->match_team_2_score) ? $news->match_team_2_score : ''; ?>"> </div> </div> </div> </div> </div> </div> </div> </div> </form> <script src="/assets/ckeditor/ckeditor.js"></script> <script src="/assets/ckeditor/adapters/jquery.js"></script> <script type="text/javascript"> $(function() { $('.ckeditor').ckeditor({height: 450}); $('button.btn-danger').on('click', function() { return confirm('Are you sure you want to delete this article?'); }); }); </script>
Cancel