Exemplo n.º 1
0
 function build_edit_zodiac_popup($id)
 {
     $db_functions_obj = new DbFunctions();
     $helper_obj = new Helper();
     $zodiac_info = $db_functions_obj->get_zodiac_by_id($id);
     global $base_path;
     $operator = new Operator();
     $output = "<div class='popup-header'>" . $helper_obj->t("Edit Zodiac") . "</div>";
     $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_zodiac' id='edit_zodiac' method='post' action='{$base_path}" . "edit_zodiac'>";
     //$output .= $this->build_zodiac_list($zodiac_info->name);
     $output .= "<div class='control-group'>\n                        <label class='control-label' for='textarea'>body</label>\n                        <div class='controls'>\n                            <textarea id='textarea' class='input-block-level' data-rule-required='true' rows='5' value='{$zodiac_info->body}' name='body'>{$zodiac_info->body}</textarea>\n                        </div>\n                    </div>";
     $output .= "<input type='hidden' name='zodiac_id' value='" . $zodiac_info->id . "'>";
     $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>";
     $output .= "</form>";
     $output .= "<script>\n                    \$(document).ready(function() {        \n                       \$(\"#zodiac_textfield\").datepicker();   \n                     \n                       \$('#edit_zodiac').ajaxForm(function(res) { \n                           var isvalid = \$(\"#edit_zodiac\").valid();\n                           if (isvalid) { \n                               var data = res.split(\"***#***\");   \n                               \$('#zodiac_' + data[1]).after(data[0]);\n                               \$('#zodiac_' + data[1]).remove(); \n                               closePopup();\n                           }  \n                       }); \n                    });\n                    </script>";
     return $output;
 }
Exemplo n.º 2
0
 function edit_zodiac()
 {
     $zodiac_obj = new Zodiac();
     $db_functions_obj = new DbFunctions();
     $helper_obj = new Helper();
     global $user;
     $rid = $user['rid'];
     //only super admin can delete hidt
     if ($helper_obj->user_is_logged_in() && $helper_obj->check_role(SUPER_ADMIN_ROLE_ID)) {
         $db_functions_obj->edit_zodiac($_POST['zodiac_id'], $_POST['body']);
         $zodiac_info = $db_functions_obj->get_zodiac_by_id($_POST['zodiac_id']);
         echo $zodiac_obj->build_zodiac_row($_POST['zodiac_id']) . "***#***" . $_POST['zodiac_id'];
     } else {
         $this->set_access_denied(1);
     }
     exit;
 }