示例#1
0
文件: video.php 项目: arh922/ain
 function build_edit_video_popup($vid)
 {
     $db_functions_obj = new DbFunctions();
     $validation_js_obj = new Validation_js();
     $cat_obj = new Category();
     $helper_obj = new Helper();
     $pgrate_obj = new Pgrate();
     global $base_path;
     $vid_info = $db_functions_obj->get_vid_by_id($vid);
     $output = "";
     $output = $validation_js_obj->edit_video_validation();
     $output .= "<script>\$(document).ready(function() {  \$('#edit_video').ajaxForm(function(res) { \n                        var isvalid = \$(\"#edit_video\").valid();\n                        if (isvalid) { \n                            var data = res.split(\"***#***\");   \n                            \$('#vid_' + data[1]).after(data[0]);\n                            \$('#vid_' + data[1]).remove(); \n                            closePopup();\n                        }  \n                    }); });</script>";
     $feature_checked = "";
     if ($vid_info->featured) {
         $feature_checked = "checked='checked'";
     }
     $premium_checked = "";
     if ($vid_info->premium) {
         $premium_checked = "checked='checked'";
     }
     $output .= "<div class='popup-header'>" . $helper_obj->t("Edit Video") . " " . $vid_info->title . "</div>";
     $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_video' id='edit_video' method='post' action='{$base_path}" . "edit_video'>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Title</label>\n                        <div class='controls'>\n                           <input type='text' id='title_updated' name='title_updated' value='" . $vid_info->title . "'>\n                        </div>\n                      </div>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Title</label>\n                        <div class='controls'>\n                           <textarea name='description_updated' id='description_updated'>{$vid_info->description}</textarea>\n                        </div>\n                      </div>";
     $output .= $cat_obj->build_categories_list('edit', $vid_info->cat_id);
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Image1</label>\n                        <div class='controls'>\n                            <input accept='image/*' type='file' name='image1_updated' id='image1_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image1 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n                        </div>\n                      </div>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Image2</label>\n                        <div class='controls'>\n                            <input accept='image/*' type='file' name='image2_updated' id='image2_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image2 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n                        </div>\n                      </div>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Image3</label>\n                        <div class='controls'>\n                             <input accept='image/*' type='file' name='image3_updated' id='image3_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image3 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n                        </div>\n                      </div>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Image4</label>\n                        <div class='controls'>\n                            <input accept='image/*' type='file' name='image4_updated' id='image4_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image4 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n                        </div>\n                      </div>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>ScreenShot</label>\n                        <div class='controls'>\n                            <input accept='image/*' type='file' name='screenshot_updated' id='screenshot_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->screenshot . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n                        </div>\n                     </div>";
     $output .= $pgrate_obj->build_pgrate_list("edit", $vid_info->pgrate_id);
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Featured</label>\n                        <div class='controls'>\n                           <input {$feature_checked} type='checkbox' value='1' id='featured_updated' name='featured_updated'>" . $helper_obj->t("Featured") . "</div>\n                      </div>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Premium</label>\n                        <div class='controls'>\n                          <input {$premium_checked} type='checkbox' value='1' id='premium_updated' name='premium_updated'>" . $helper_obj->t("Premium") . "</div>\n                      </div>";
     $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>";
     $output .= "<input type='hidden' name='edit_vid' id='edit_vid' value='" . $vid_info->id . "'>";
     $output .= "</form>";
     return $output;
 }