/01.Source/01.CORE/modules/video/admin/edit.php
PHP | 108 lines | 104 code | 0 blank | 4 comment | 12 complexity | 78e8aea0129ab0693c3fc12f3cbc94e1 MD5 | raw file
Possible License(s): BSD-3-Clause
- <?php
- if ( ! defined( 'NV_IS_VIDEO_ADMIN' ) ) { die( 'Stop!!!' ); }
- $page_title = "S?a Video";
- $edit = 0;
- $error = "";
- $id = $nv_Request->get_int( 'id', 'post,get',0 );
- if ( $nv_Request->get_int( 'edit', 'post' ) == 1 )
- {
- $title = filter_text_input( 'title', 'post', '', 1 );
- $duongdan = filter_text_input( 'duongdan', 'post', '', 1 );
- $thumb = filter_text_input( 'thumb', 'post', '', 1 );
- $theloai = $nv_Request->get_int( 'theloai', 'post',0 );
- $who_post = filter_text_input( 'who_post', 'post', '', 1 );
- if ( empty( $title ) ) { $error = "L?i: Ch?a ?i?n tęn album"; } else
- if ( empty( $thumb ) ) { $error = "L?i: Ch?a ?i?n thông tin ?nh hi?n th?"; } else
- if ( empty( $who_post ) ) { $error = "L?i: Ch?a có ng??i ??ng"; }
- else
- {
- $query = mysql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "` SET `title` = " . $db->dbescape( $title ) . " WHERE `id` =" . $id . "");
- $query = mysql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "` SET `thumb` = " . $db->dbescape( $thumb ) . " WHERE `id` =" . $id . "");
- $query = mysql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "` SET `duongdan` = " . $db->dbescape( $duongdan ) . " WHERE `id` =" . $id . "");
- $query = mysql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "` SET `theloai` = " . $db->dbescape( $theloai ) . " WHERE `id` =" . $id . "");
- $query = mysql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "` SET `who_post` = " . $db->dbescape( $who_post ) . " WHERE `id` =" . $id . "");
- if ($query)
- {
- Header( "Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name); die();
- }
- else { $error = "Có l?i trong quá trěnh l?u d? li?u hăy ki?m tra l?i"; }
- }
- }
- if ( $error != "" )
- {
- $contents .= "<div class=\"quote\" style=\"width:780px;\">\n";
- $contents .= "<blockquote class=\"error\"><span>" . $error . "</span></blockquote>\n";
- $contents .= "</div>\n";
- $contents .= "<div class=\"clear\"></div>\n";
- }
- $sql = "SELECT id, title, thumb, duongdan, theloai, who_post FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `id` = '" . $id . "'";
- $resuilt = $db->sql_query( $sql );
- $row = $db->sql_fetchrow( $resuilt );
- $contents .= "<form action=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=edit&id=".$id."\" enctype=\"multipart/form-data\" method=\"post\">";
- $contents .= "<br /><p><strong>Nh?p vŕo ??y ?? thông tin cho album:</strong> L?u ý các thông tin ??u lŕ b?t bu?c</p>";
- $contents .= " <table class=\"tab1\">\n";
- $contents .= " <tr>\n";
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- $contents .= " <td width=\"30%\"><strong>Tęn video:</strong></td>\n";
- $contents .= " <td>\n";
- $contents .= " <input type=\"text\" value=\"".$row['title']."\" name=\"title\" size=\"100\">\n";
- $contents .= " </td>\n";
- $contents .= " </tr>\n";
- $contents .= " <tr>\n";
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- $contents .= " <td width=\"30%\"><strong>Ch?n th? lo?i:</strong>\n";
- $contents .= " <td>\n";
- $contents .= " <select name=\"theloai\" >";
- $sql = "SELECT id, num, title FROM `" . NV_PREFIXLANG . "_" . $module_data . "_category` ORDER BY num DESC";
- $resuilt = $db->sql_query( $sql );
- while ( $row = $db->sql_fetchrow( $resuilt ) )
- {
- $contents .= " <option value=\"".$row['num']."\">".$row['title']."</option>";
- }
- $contents .= " </select>\n";
- $contents .= " </td>\n";
- $contents .= " </tr>\n";
- $contents .= " <tr>\n";
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- $sql = "SELECT id, title, thumb, duongdan, theloai, who_post FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `id` = '" . $id . "'";
- $resuilt = $db->sql_query( $sql );
- $row = $db->sql_fetchrow( $resuilt );
- $contents .= " <td width=\"30%\"><strong>Ng??i ??ng:</strong></td>\n";
- $contents .= " <td colspan=\"2\">\n";
- $contents .= " <input type=\"text\" value=\"".$row['who_post']."\" name=\"who_post\" size=\"100\">\n";
- $contents .= " </td>\n";
- $contents .= " </tr>\n";
- $contents .= " <tr>\n";
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- $contents .= " <td width=\"30%\"><strong>?nh hi?n th?:</strong></td>\n";
- $contents .= " <td style=\"background:#eee;\" valign=\"middle\">
- <input style=\"width: 400px;\" value=\"".$row['thumb']."\" name=\"thumb\" id=\"thumb\" type=\"text\" />
- </td>
- <td style=\"background:#eee;\" valign=\"middle\">
- <input value=\"Ch?n ?nh\" name=\"selectimg\" type=\"button\"/>
- <script type=\"text/javascript\">
- $(\"input[name=selectimg]\").click(function()
- {
- var area = \"thumb\"; // return value area
- var type = \"image\";
- var path = \"".NV_UPLOADS_DIR . "/" . $module_name."/thumb\";
- nv_open_browse_file(\"".NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=upload&popup=1&area=" + area+"&path="+path+"&type="+type, "NVImg", "850", "500","resizable=no,scrollbars=no,toolbar=no,location=no,status=no'."\");
- return false;
- });
- </script></td> ";
- $contents .= " </tr>\n";
- $contents .= "</table>\n";
- $contents .= "<table class=\"tab2\" align=\"center\">\n";
- $contents .= " <tr>\n";
- $contents .= " <td style=\"text-align:center;\">\n";
- $contents .= " <input type=\"submit\" value=\"L?u\"/>\n";
- $contents .= " <input name=\"edit\" type=\"hidden\" value=\"1\" />\n";
- $contents .= " <input type=\"hidden\" name =\"" . NV_NAME_VARIABLE . "\"value=\"" . $module_name . "\" />"; $contents .= " <input type=\"hidden\" name =\"" . NV_OP_VARIABLE . "\"value=\"" . $op . "\" />";
- $contents .= " </td>\n";
- $contents .= " </tr>\n";
- $contents .= " </table>\n";
- $contents .= "</form>\n";
- include ( NV_ROOTDIR . "/includes/header.php" );
- echo nv_admin_theme( $contents );
- include ( NV_ROOTDIR . "/includes/footer.php" );
- ?>