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/vajra.id/public_html/application/views/admin/blog/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <a href="<?= base_url('admin/blog'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to News & Events List Page</a><br><br> <h4><?= empty($blog->id_blog) ? 'Add a new blog' : 'Edit News & Events : ' . $blog->blog; ?></h4> <?= $this->session->flashdata('success'); //to display success message ?> <?= $this->session->flashdata('result'); //to display result message ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <?= form_open_multipart(); ?> <div class="row"> <div class="col-sm-3"> <p>Title</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <!-- <ul class="nav nav-tabs"> <li class="active"><a href="#title_id" data-toggle="tab">Indonesian</a></li> <li><a href="#title_en" data-toggle="tab">English</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="title_id"> --> <p> <?php $data = array( 'name' => 'blog_name', 'value' => $blog->blog, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('blog_name'); ?></p> <!-- </div> --><!-- end id="#description_id" --> <!-- <div class="tab-pane" id="title_en"> <p> <?php $data = array( 'name' => 'blog_name_en', 'value' => $blog->blog_en, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('blog_name_en'); ?></p> </div> </div> --> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display: none;"> <div class="col-sm-3"> <p>Author Name (eg. admin)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'author', 'value' => $blog->author, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('author'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display: none;"> <div class="col-sm-3"> <p>Blog Category</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="parent_id" class="form-control" id="chooseCategory"> <option value="no-parent" <?php if ($categories->parent == NULL) : ?> selected="selected" <?php endif; ?> >No category</option> <?php foreach($parent_categories as $parent) : ?> <option value="<?= $parent->id_categories; ?>" <?php if ($categories->parent == $parent->id_categories): ?> selected="selected" <?php endif ?> ><?= ucfirst($parent->category); ?></option> <?php $this->db->select('*')->from('categories')->where('parent', $parent->id_categories)->order_by('priority', 'ASC'); $child = $this->db->get()->result(); ?> <?php foreach ($child as $child_category) : ?> <option value="<?= $child_category->id_categories; ?>" <?php if ($categories->parent == $child_category->id_categories): ?> selected="selected" <?php endif ?> >- <?= ucfirst($child_category->category); ?></option> <?php endforeach; ?> <?php endforeach; ?> </select> <p><?= form_error('parent_id'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Blog Category</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div style="height: 200px; overflow-y: scroll; padding: 20px; border:1px solid #ccc;"> <?php foreach($parent_categories as $category) : ?> <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="category_id[]" value="<?= $category->id_categories; ?>" <?= set_checkbox('category_id[]', $category->id_categories); ?> <?php if (isset($chosen_categories)) : ?> <?php //checked item foreach ($chosen_categories as $chosen_category) : ?> <?php if ($chosen_category->id_category == $category->id_categories) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> > <?= ucfirst($category->category); ?> <br> <?php //check if this parent categories does have sub categories $this->db->select('id_categories')->from('categories')->where('parent', $category->id_categories); $count_child = $this->db->get()->num_rows(); ?> <?php if ($count_child > 0) : //this category does have childen ?> <?php //get all child categories $this->db->select('*')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC'); $child_categories = $this->db->get()->result(); ?> <?php foreach ($child_categories as $child) : ?> -- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $child->id_categories; ?>" <?= set_checkbox('category_id[]', $child->id_categories); ?> <?php if (isset($chosen_categories)) : ?> <?php //checked item foreach ($chosen_categories as $chosen_category) : ?> <?php if ($chosen_category->id_category == $child->id_categories) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> > <?= ucfirst($child->category); ?> <br> <?php //check if this parent categories does have sub categories $this->db->select('id_categories')->from('categories')->where('parent', $child->id_categories); $count_grandchild = $this->db->get()->num_rows(); ?> <?php if ($count_grandchild > 0) : //this category does have childen ?> <?php //get all child categories $this->db->select('*')->from('categories')->where('parent', $child->id_categories)->order_by('priority', 'ASC'); $grandchild_categories = $this->db->get()->result(); ?> <?php foreach ($grandchild_categories as $grandchild) : ?> ------- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $grandchild->id_categories; ?>" <?= set_checkbox('category_id[]', $grandchild->id_categories); ?> <?php if (isset($chosen_categories)) : ?> <?php //checked item foreach ($chosen_categories as $chosen_category) : ?> <?php if ($chosen_category->id_category == $grandchild->id_categories) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> > <?= ucfirst($grandchild->category); ?> <br> <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> </div> <?= form_error('category_id[]'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Publish Date</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php //get blog pulish date from database, convert to dd-mm-yy format if(!empty($blog->publish_date)) { $publish_date = date('d-m-Y', strtotime($blog->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><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Image Banner<br> <?php if (!empty($blog->image2)) : ?> <img style="width:100px; height:auto;" src="<?= base_url() . 'uploads/blog/' . $blog->image2; ?>" alt="" /> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/blog/delete_image/' . $blog->id_blog . '/image2'; ?>">Delete</a> <?php endif; ?> </p> </div><!-- end class="col-sm-3" --> <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('blog_image_width, blog_image_height, blog_thumbnail_width, blog_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->blog_image_width;?> pixel width. <?= $image_dimension->blog_image_height;?> pixel height, jpg/png, 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><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Intro Image Thumbnail<br> <?php if (!empty($blog->image1)) : ?> <img style="width:100px; height:auto;" src="<?= base_url() . 'uploads/blog/' . $blog->image1; ?>" alt="" /> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/blog/delete_image/' . $blog->id_blog . '/image1'; ?>">Delete</a> <?php endif; ?> </p> </div><!-- end class="col-sm-3" --> <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->blog_thumbnail_width;?> pixel width. <?= $image_dimension->blog_thumbnail_height;?> pixel height, jpg/png, max 300KB</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><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Upload PDF<br> </p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p><input type="file" name="image3" size="20" class="form-control" /> <?php if (!empty($blog->upload_pdf)) : ?> <?= $blog->upload_pdf;?> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/blog/delete_pdf/' . $blog->id_blog . '/upload_pdf'; ?>">Delete</a> <?php endif; ?> <br> <span style="font-size:12px; font-style: italic;">Type of file must be .pdf size max 5MB</span><br> <span style="color:#F7931E;"><?php echo form_error('image3'); ?></span> <?php echo $this->session->flashdata('image3-error'); //to display error message ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Intro-Content</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <!-- <ul class="nav nav-tabs"> <li class="active"><a href="#description_id" data-toggle="tab">Indonesian</a></li> <li><a href="#description_en" data-toggle="tab">English</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="description_id"> --> <?php echo form_textarea('description_en', set_value('description_en', $blog->description_en, FALSE)); ?> <?php echo form_error('description_en'); ?> <!-- </div> --><!-- end id="#description_id" --> <!-- <div class="tab-pane" id="description_en"> <?php echo form_textarea('description_en', set_value('description_en', $blog->description_en, FALSE)); ?> <?php echo form_error('description_en'); ?> </div> </div> --> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Content</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <!-- <ul class="nav nav-tabs"> <li class="active"><a href="#description_id" data-toggle="tab">Indonesian</a></li> <li><a href="#description_en" data-toggle="tab">English</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="description_id"> --> <?php echo form_textarea('description', set_value('description', $blog->description, FALSE)); ?> <?php echo form_error('description'); ?> <!-- </div> --><!-- end id="#description_id" --> <!-- <div class="tab-pane" id="description_en"> <?php echo form_textarea('description_en', set_value('description_en', $blog->description_en, FALSE)); ?> <?php echo form_error('description_en'); ?> </div> </div> --> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Artikel Populer ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <?php $options = array( 1 => 'Yes', 0 => 'No' ); echo form_dropdown('populer', $options, $blog->populer, 'class="form-control"'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Display</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <?php $options = array( 1 => 'Yes', 0 => 'No' ); echo form_dropdown('status', $options, $blog->status, 'class="form-control"'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <?= form_submit('submit', 'Update', 'class="btn btn-primary btn-success button-brown"'); ?> <?= anchor('admin/blog', 'cancel'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?= form_close(); ?>