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; }
function build_edit_article_popup($aid) { $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; $article_info = $db_functions_obj->get_article_by_id($aid); $output = ""; $output = $validation_js_obj->edit_article_validation(); $output .= "<script>\$(document).ready(function() { \$('#edit_article').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_article\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#article_' + data[1]).after(data[0]);\n \$('#article_' + data[1]).remove(); \n closePopup();\n } \n }); });</script>"; $output .= "<div class='popup-header'>" . $helper_obj->t("Edit Article") . " " . $article_info->title . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_article' id='edit_article' method='post' action='{$base_path}" . "edit_article'>"; $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='" . $article_info->title . "'>\n </div>\n </div>"; $output .= $cat_obj->build_categories_list('edit', $article_info->cat_id); $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Text1</label>\n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 231px'>\n <textarea name='text1_updated' id='text1_updated'>{$article_info->text1}</textarea><br />\n <input type='text' style='font-size: 11px;width: 65px' name='text1_order_updated' value='{$article_info->text1_order}'></input>\n </div>\n \n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 231px'>\n <textarea name='text2_updated' id='text2_updated'>{$article_info->text2}</textarea> <br />\n <input type='text' style='font-size: 11px;width: 65px' name='text2_order_updated' value='{$article_info->text2_order}'></input> \n </div>\n \n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 233px'>\n <textarea name='text3_updated' id='text3_updated'>{$article_info->text3}</textarea> <br />\n <input type='text' style='font-size: 11px;width: 65px' name='text3_order_updated' value='{$article_info->text3_order}'></input> \n </div>\n \n </div>"; /* $output .= "<div class='control-group'> <label class='control-label' for='client_name'>Text2</label> <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 231px'> <textarea name='text2_updated' id='text2_updated'>$article_info->text2</textarea> <br /> <input type='text' style='font-size: 11px;width: 65px' name='text2_order_updated' value='$article_info->text2_order'></input> </div> <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 49%'> <textarea name='text3_updated' id='text3_updated'>$article_info->text3</textarea> <br /> <input type='text' style='font-size: 11px;width: 65px' name='text3_order_updated' value='$article_info->text3_order'></input> </div> </div>"; */ /* $output .= "<div class='control-group'> <label class='control-label' for='client_name'>Text3</label> <div class='controls'> <textarea name='text3_updated' id='text3_updated'>$article_info->text3</textarea> <br /> <input type='text' style='font-size: 11px;width: 65px' name='text3_order_updated' value='$article_info->text3_order'></input> </div> </div>"; */ $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 . $article_info->image1 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image1_order_updated' value='{$article_info->image1_order}'></input> \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 . $article_info->image2 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image2_order_updated' value='{$article_info->image2_order}'></input>\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 . $article_info->image3 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image3_order_updated' value='{$article_info->image3_order}'></input>\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 . $article_info->image4 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image4_order_updated' value='{$article_info->image4_order}'></input>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image5</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image5_updated' id='image5_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info->image5 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image5_order_updated' value='{$article_info->image5_order}'></input>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Video1</label>\n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;'>\n <input type='text' name='video1_updated' value='{$article_info->video1}'></input><br />\n <input type='text' style='font-size: 11px;width: 65px' name='video1_order_updated' value='{$article_info->video1_order}'></input> \n </div>\n \n <div class='controls' style='float: left; margin-right: -70; margin-left: 0; width: 49%'>\n <input type='text' name='video2_updated' value='{$article_info->video2}'></input><br />\n <input type='text'style='font-size: 11px;width: 65px' name='video2_order_updated' value='{$article_info->video2_order}'></input>\n </div>\n \n </div>"; /*$output .= "<div class='control-group'> <label class='control-label' for='client_name'>Video2</label> <div class='controls'> <input type='text' name='video2_updated' value='$article_info->video2'></input><br /> <input type='text'style='font-size: 11px;width: 65px' name='video2_order_updated' value='$article_info->video2_order'></input> </div> </div>"; */ $output .= $pgrate_obj->build_pgrate_list("edit", $article_info->pgrate_id); /* $output .= "<div class='control-group'> <label class='control-label' for='client_name'>Ordering</label> <div class='controls'> </div> </div>"; */ $radio1 = ""; $radio2 = ""; $radio3 = ""; if ($article_info->section == 1) { $radio1 = "checked='checked'"; } if ($article_info->section == 2) { $radio2 = "checked='checked'"; } if ($article_info->section == 3) { $radio3 = "checked='checked'"; } $output .= '<div class="control-group"> <label class="control-label">Main Category in home page</label> <div class="controls"> <label class="radio"> <input ' . $radio1 . ' type="radio" name="section" value="1"> Top Section </label> <label class="radio"> <input ' . $radio2 . ' type="radio" name="section" value="2"> Middle Section </label> <label class="radio"> <input ' . $radio3 . ' type="radio" name="section" value="3"> Bottom Section </label> </div> </div>'; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "<input type='hidden' name='edit_article' id='edit_article' value='" . $article_info->id . "'>"; $output .= "</form>"; return $output; }