public function form()
 {
     $this->views = new Views(new Template("admin"));
     Phalanx::loadClasses('Testimonials');
     $this->views->data = Testimonials::get($this->get->id);
     $this->views->display('testimonials_form.phtml');
 }
    $testi->testimonial_id = $testimonial_id;
    $testi->delete_testimonial();
}
// function for deny
function deny_testimonial($testimonial_id)
{
    $testi = new Testimonials();
    $testi->testimonial_id = $testimonial_id;
    $testi->status = DENIED;
    $testi->change_status();
}
global $page_uid;
if ($_GET['action']) {
    $testi = new Testimonials();
    $testi->testimonial_id = $_GET['id'];
    $result = $testi->get();
    // handle all the action here
    if ($login_uid != $result['recipient_id']) {
        $location = PA::$url . PA_ROUTE_USER_PRIVATE . '/' . "msg_id=9010";
    }
    if ($_GET['action'] == 'deny') {
        deny_testimonial($testi->testimonial_id);
        $location = PA::$url . PA_ROUTE_USER_PRIVATE . '/' . "msg_id=9012";
    }
    if ($_GET['action'] == 'approve') {
        approved_testimonial($testi->testimonial_id);
        $location = PA::$url . PA_ROUTE_USER_PRIVATE . '/' . "msg_id=9011";
    }
    if ($_GET['action'] == 'delete') {
        delete_testimonial($testi->testimonial_id);
        $login = User::get_login_name_from_id($page_uid);
 public function getTestimonials($limit = 5)
 {
     return Testimonials::get()->limit($limit);
 }
 public function testGet_WithEmptyTestimonialId()
 {
     $testi = new Testimonials();
     $testi->testimonial_id = NULL;
     try {
         $testi->get();
     } catch (PAException $e) {
         $error = $e->message;
         $code = $e->code;
     }
     $this->assertEquals($code, REQUIRED_PARAMETERS_MISSING);
 }