header('Location:' . osc_admin_render_theme_url($ct_url)); } } ?> <h1>Testimonial Information</h1> <form name="testimonial-form" method="post" action=""> <?php if (Params::getParam('nepcoders_action') == 'edit') { ?> <input type="hidden" name="nep_action" value="edit_testimonial"> <input type="hidden" name="testimonial_id" value="<?php echo Params::getParam('tid'); ?> "> <?php $result = Testimonial::newInstance()->getTestimonial(Params::getParam('tid')); $title = $result['testimonial_title']; $image_url = $result['testimonial_image']; $message = $result['testimonial_message']; ?> <?php } else { ?> <input type="hidden" name="nepcoders_action" value="insert_testimonial"/> <?php } ?> <div class="form-group"> <label for="title">Title</label> <input class="form-control" id="title" name="title" value="<?php echo $title;
<?php $testo = Testimonial::newInstance()->testimonialList(); $ct_url = 'oc-content/themes/nepcoders/admin/add-edit-testimonial.php'; ?> <a href='<?php echo osc_admin_render_theme_url($ct_url); ?> '>Add new testimonial</a> <table class="table" cellpadding="0" cellspacing="0"> <thead> <tr> <th class="col-status ">Title</th> </tr> </thead> <tbody> <?php foreach ($testo as $test) { echo '<tr><td>' . $test['testimonial_title'] . '</td>'; echo "<td><a href='" . osc_admin_render_theme_url($ct_url) . "?nepcoders_action=edit&tid=" . $test["pk_testimonial_id"] . "'>Edit</a></td>"; echo '</tr>'; } ?> </tbody> </table>