]][ahhhhhhhasdasdassasdkksdadddsddfgh
במ12[aspddfsdfsdfdfnsd g ggk ffghaskjjsaddddkdasdasd asdadghdgh;';';'
/
home
/
swordshipmanagem
/
public_html
/
admin
/
Upload FileeE
HOME
<?php require('database.php'); session_start(); error_reporting(0); function do_login() { if (isset($_POST['login'])) { $user = md5($_POST['username']); $pass = md5($_POST['password']); //require('database.php'); $ob = new database(); $ob->query("SELECT * FROM admin where username='$user' and password='$pass'"); if ($ob->numRows() >= 1) { foreach($ob->rows() as $data) { $_SESSION['user'] = $_POST['username']; $_SESSION['id'] = $data['id']; echo '<script>parent.location.assign("home.php")</script>'; } }else{ echo '<script>alert("Username and Password not matched.")</script>'; } } } function check_login() { if (empty($_SESSION['user'])) { header('Location:index.php'); } } function logout() { session_start(); session_destroy(); header("Location:index.php"); } function head() { ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Baba Garments</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Complete Web Solution like Web Development, Web Designing, PHP Development, Jquery Templates."> <meta name="author" content="HD Infotech"> <!-- The styles --> <link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet"> <style type="text/css"> body { padding-bottom: 40px; } .sidebar-nav { padding: 9px 0; } </style> <link href="css/bootstrap-responsive.css" rel="stylesheet"> <link href="css/charisma-app.css" rel="stylesheet"> <link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet"> <link href='css/fullcalendar.css' rel='stylesheet'> <link href='css/fullcalendar.print.css' rel='stylesheet' media='print'> <link href='css/chosen.css' rel='stylesheet'> <link href='css/uniform.default.css' rel='stylesheet'> <link href='css/colorbox.css' rel='stylesheet'> <link href='css/jquery.cleditor.css' rel='stylesheet'> <link href='css/jquery.noty.css' rel='stylesheet'> <link href='css/noty_theme_default.css' rel='stylesheet'> <link href='css/elfinder.min.css' rel='stylesheet'> <link href='css/elfinder.theme.css' rel='stylesheet'> <link href='css/jquery.iphone.toggle.css' rel='stylesheet'> <link href='css/opa-icons.css' rel='stylesheet'> <link href='css/uploadify.css' rel='stylesheet'> <!-- The HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- The fav icon --> <link rel="shortcut icon" href="img/favicon.ico"> </head> <?php } function copyright() { ?> <footer> <p class="pull-left">© Copyright & All Rights Reserved By <a href="../index.php" target=_blank>Ideal Furnitures</a></p> <p class="pull-right">Powered by: <a href="http://www.hdinfotech.co.uk" target="_blank">HD Infotech</a></p> </footer> <?php } function footer() { ?> <!-- jQuery --> <script src="js/jquery-1.7.2.min.js"></script> <!-- jQuery UI --> <script src="js/jquery-ui-1.8.21.custom.min.js"></script> <!-- transition / effect library --> <script src="js/bootstrap-transition.js"></script> <!-- alert enhancer library --> <script src="js/bootstrap-alert.js"></script> <!-- modal / dialog library --> <script src="js/bootstrap-modal.js"></script> <!-- custom dropdown library --> <script src="js/bootstrap-dropdown.js"></script> <!-- scrolspy library --> <script src="js/bootstrap-scrollspy.js"></script> <!-- library for creating tabs --> <script src="js/bootstrap-tab.js"></script> <!-- library for advanced tooltip --> <script src="js/bootstrap-tooltip.js"></script> <!-- popover effect library --> <script src="js/bootstrap-popover.js"></script> <!-- button enhancer library --> <script src="js/bootstrap-button.js"></script> <!-- accordion library (optional, not used in demo) --> <script src="js/bootstrap-collapse.js"></script> <!-- carousel slideshow library (optional, not used in demo) --> <script src="js/bootstrap-carousel.js"></script> <!-- autocomplete library --> <script src="js/bootstrap-typeahead.js"></script> <!-- tour library --> <script src="js/bootstrap-tour.js"></script> <!-- library for cookie management --> <script src="js/jquery.cookie.js"></script> <!-- calander plugin --> <script src='js/fullcalendar.min.js'></script> <!-- data table plugin --> <script src='js/jquery.dataTables.min.js'></script> <!-- chart libraries start --> <script src="js/excanvas.js"></script> <script src="js/jquery.flot.min.js"></script> <script src="js/jquery.flot.pie.min.js"></script> <script src="js/jquery.flot.stack.js"></script> <script src="js/jquery.flot.resize.min.js"></script> <!-- chart libraries end --> <!-- select or dropdown enhancer --> <script src="js/jquery.chosen.min.js"></script> <!-- checkbox, radio, and file input styler --> <script src="js/jquery.uniform.min.js"></script> <!-- plugin for gallery image view --> <script src="js/jquery.colorbox.min.js"></script> <!-- rich text editor library --> <script src="js/jquery.cleditor.min.js"></script> <!-- notification plugin --> <script src="js/jquery.noty.js"></script> <!-- file manager library --> <script src="js/jquery.elfinder.min.js"></script> <!-- star rating plugin --> <script src="js/jquery.raty.min.js"></script> <!-- for iOS style toggle switch --> <script src="js/jquery.iphone.toggle.js"></script> <!-- autogrowing textarea plugin --> <script src="js/jquery.autogrow-textarea.js"></script> <!-- multiple file upload plugin --> <script src="js/jquery.uploadify-3.1.min.js"></script> <!-- history.js for cross-browser state change on ajax --> <script src="js/jquery.history.js"></script> <!-- application script for Charisma demo --> <script src="js/charisma.js"></script> <?php } function navigation() { ?> <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".top-nav.nav-collapse,.sidebar-nav.nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="home.php"> <img alt="Logo" src="img/logo20.png" /> <span> Ideal Furnitures</span></a> <!-- theme selector starts --> <div class="btn-group pull-right theme-container" > <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <i class="icon-tint"></i><span class="hidden-phone"> Change Theme / Skin</span> <span class="caret"></span> </a> <ul class="dropdown-menu" id="themes"> <li><a data-value="classic" href="#"><i class="icon-blank"></i> Classic</a></li> <li><a data-value="cerulean" href="#"><i class="icon-blank"></i> Cerulean</a></li> <li><a data-value="cyborg" href="#"><i class="icon-blank"></i> Cyborg</a></li> <li><a data-value="redy" href="#"><i class="icon-blank"></i> Redy</a></li> <li><a data-value="journal" href="#"><i class="icon-blank"></i> Journal</a></li> <li><a data-value="simplex" href="#"><i class="icon-blank"></i> Simplex</a></li> <li><a data-value="slate" href="#"><i class="icon-blank"></i> Slate</a></li> <li><a data-value="spacelab" href="#"><i class="icon-blank"></i> Spacelab</a></li> <li><a data-value="united" href="#"><i class="icon-blank"></i> United</a></li> </ul> </div> <!-- theme selector ends --> <!-- user dropdown starts --> <div class="btn-group pull-right" > <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <i class="icon-user"></i><span class="hidden-phone"> admin</span> <span class="caret"></span> </a> <ul class="dropdown-menu"> <li><a href="#">Profile</a></li> <li class="divider"></li> <li><a href="logout.php">Logout</a></li> </ul> </div> <!-- user dropdown ends --> <div class="top-nav nav-collapse"> <!--<ul class="nav"> <li><a href="#">Visit Site</a></li> <li> <form class="navbar-search pull-left"> <input placeholder="Search" class="search-query span2" name="query" type="text"> </form> </li> </ul>--> </div><!--/.nav-collapse --> </div> </div> </div> <?php } function menu() { ?> <div class="span2 main-menu-span"> <div class="well nav-collapse sidebar-nav"> <ul class="nav nav-tabs nav-stacked main-menu"> <li class="nav-header hidden-tablet">Main</li> <li><a class="ajax-link" href="home.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li> <li><a class="ajax-link" href="gallery.php"><i class="icon-picture"></i><span class="hidden-tablet"> Gallery</span></a></li> <li><a class="ajax-link" href="slider.php"><i class="icon-signal"></i><span class="hidden-tablet"> Slider Images</span></a></li> <li><a class="ajax-link" href="view_cat.php"><i class="icon-signal"></i><span class="hidden-tablet"> Category</span></a></li> <li><a class="ajax-link" href="product.php"><i class="icon-signal"></i><span class="hidden-tablet"> Product</span></a></li> <li><a class="ajax-link" href="about.php"><i class="icon-file"></i><span class="hidden-tablet"> About Us</span></a></li> </ul> </div><!--/.well --> </div><!--/span--> <?php } function fancy() { ?> <!--<script type="text/javascript" src="fancy/lib/jquery-1.9.0.min.js"></script>--> <!-- Add mousewheel plugin (this is optional) --> <script type="text/javascript" src="fancy/lib/jquery.mousewheel-3.0.6.pack.js"></script> <!-- Add fancyBox main JS and CSS files --> <script type="text/javascript" src="fancy/source/jquery.fancybox.js?v=2.1.4"></script> <link rel="stylesheet" type="text/css" href="fancy/source/jquery.fancybox.css?v=2.1.4" media="screen" /> <!-- Add Button helper (this is optional) --> <link rel="stylesheet" type="text/css" href="fancy/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" /> <script type="text/javascript" src="fancy/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script> <!-- Add Thumbnail helper (this is optional) --> <link rel="stylesheet" type="text/css" href="fancy/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" /> <script type="text/javascript" src="fancy/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script> <!-- Add Media helper (this is optional) --> <script type="text/javascript" src="fancy/source/helpers/jquery.fancybox-media.js?v=1.0.5"></script> <script type="text/javascript"> $(document).ready(function() { $('.fancybox').fancybox({ afterClose : function() { return; } }); $("#fancybox-manual-b").click(function() { $.fancybox.open({ type : 'iframe', padding : 0, }); }); }); </script> <?php } function gallery() { if(isset($_POST['add_gallery'])) { //require('database.php'); $output_dir = 'upload/'; $title = $_POST['title']; if(isset($_FILES["image"]["name"])) { if (!is_dir($output_dir)) { mkdir($output_dir); } $error =$_FILES["image"]["error"]; { if(is_array($_FILES["image"]['name'])) { $ob = new database(); $fileCount = count($_FILES["image"]['name']); for($i=0; $i < $fileCount; $i++) { $r = rand(-1,1234567890); $fileName = $_FILES["image"]["name"][$i]; $ret[$fileName]= $output_dir.$fileName; if (move_uploaded_file($_FILES["image"]["tmp_name"][$i],$output_dir.$r.$fileName )) { $ob->query("INSERT INTO gallery set title='$title', name='".$output_dir.$r.$fileName."'"); } } $iid = mysql_insert_id(); if(!empty($iid)) { echo '<script>alert("'.$fileCount.' Images Upload Successfully.")</script>'; echo '<script>parent.location.assign("gallery.php")</script>'; }else{ echo '<script>alert("Failed.\nTry Again.")</script>'; } } } } } } function add_slider_img() { if(isset($_POST['add_slide_img'])) { //echo $_GET['title']; require('database.php'); $ob = new database(); $target = 'slider/'; if (!is_dir($target)) { mkdir($target); } $c = count($_FILES['image']['name']); for($i=0; $i<$c; $i++) { $r = rand(0123456789,1234567890); $pic = $target.$r.$_FILES['image']['name'][$i]; $ob->query("INSERT INTO slider SET name='$pic'"); move_uploaded_file($_FILES['image']['tmp_name'][$i], $pic); } $n = mysql_insert_id(); if (!empty($n)) { echo '<script>alert("'.$c.' Images Successfully Uploaded")</script>'; echo '<script>parent.jQuery.fancybox.close()</script>'; echo '<script>parent.location.assign("slider.php")</script>'; }else{ echo '<script>alert("Failed.\nTry Again.")</script>'; } } } function add_img() { if(isset($_POST['add_img'])) { //echo $_GET['title']; //require('database.php'); $ob = new database(); $target = 'upload/'; if (!is_dir($target)) { mkdir($target); } $c = count($_FILES['image']['name']); for($i=0; $i<$c; $i++) { $r = rand(0123456789,1234567890); $pic = $target.$r.$_FILES['image']['name'][$i]; $ob->query("INSERT INTO gallery SET title='$_GET[title]', name='$pic'"); move_uploaded_file($_FILES['image']['tmp_name'][$i], $pic); } $n = mysql_insert_id(); if (!empty($n)) { echo '<script>alert("'.$c.' Images Successfully Uploaded")</script>'; echo '<script>parent.jQuery.fancybox.close()</script>'; echo '<script>parent.location.reload()</script>'; }else{ echo '<script>alert("Failed.\nTry Again.")</script>'; } } } function edit_about() { if (isset($_POST['edit_about'])) { //require('database.php'); $title = $_POST['title']; $desc = mysql_real_escape_string($_POST['desc']); $ob = new database(); $ob->query("UPDATE about SET title='$title', description='$desc' where id='$_GET[id]'"); echo '<script>alert("Data Successfully Updated.")</script>'; echo '<script>parent.jQuery.fancybox.close()</script>'; echo '<script>parent.location.reload();</script>'; } } function editor() { ?> <script src="ckeditor/ckeditor.js"></script> <script src="ckeditor/adapters/jquery.js"></script> <?php } function add_cat() { if(isset($_POST['add_cat'])) { //$id = $_GET['id']; $name = $_POST['title']; $cat = $_POST['abc']; $img = $_FILES['image']['name']; $s_desc = mysql_real_escape_string($_POST['s_desc']); $target = 'upload/'; if(!is_dir($target)) { mkdir($target); } $r = rand(0, 123456789); $pic = $target.$r.$img; $cc = explode('.', $cat); $cc[0]; $cc[1]; if($name != null && $cc[1] != 0) { if($cc[0] == "category") { $ob = new database(); $ob->query("SELECT * FROM sub_category WHERE title='$name'"); if($ob->numRows() >= 1) { echo '<script>alert("Title is Already Exist.\n")</script>'; } else { if(move_uploaded_file($_FILES['image']['tmp_name'], $pic)) { $ob->query("INSERT INTO sub_category SET title='$name', cat_id='$cc[1]', description='$s_desc', image='$pic'"); } $n = mysql_insert_id(); if($n) { echo '<script>alert("Data Added Succesfully.\n")</script>'; //echo '<script>parent.location.assign("category.php")</script>'; } else { echo '<script>alert("Error.\nPlese Try Again.")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } } } if($cc[0] == "sub_category") { $ob = new database(); $ob->query("SELECT * FROM sub_sub_category WHERE title='$name'"); if($ob->numRows() >= 1) { echo '<script>alert("Title is Already Exist.\n")</script>'; } else { if(move_uploaded_file($_FILES['image']['tmp_name'], $pic)) { $ob->query("SELECT * FROM sub_category WHERE id='$cc[1]'"); foreach($ob->rows() as $ss) { $cid = $ss['cat_id']; $ob->query("INSERT INTO sub_sub_category SET title='$name', sub_id='$cc[1]', cat_id='$cid', description='$s_desc', image='$pic'"); } } $n = mysql_insert_id(); if($n) { echo '<script>alert("Data Added Succesfully.\n")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } else { echo '<script>alert("Error.\nPlese Try Again.")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } } } } elseif($name != null && $cc[1] == 0) { $ob = new database(); $ob->query("SELECT * FROM category WHERE title='$name'"); if($ob->numRows() >= 1) { echo '<script>alert("Title is Already Exist.\n")</script>'; } else { if(move_uploaded_file($_FILES['image']['tmp_name'], $pic)) { $ob->query("INSERT INTO category SET title='$name', description='$s_desc', image='$pic'"); } $n = mysql_insert_id(); if($n) { echo '<script>alert("Data Added Succesfully.\n")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } else { echo '<script>alert("Error.\nPlese Try Again.")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } } } else { if($name == null && $cc[1] == 0) { echo '<script>alert("Name is Missing.\nPlease select any Category")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } elseif($name == null) { echo '<script>alert("Name is Missing.\n")</script>'; echo '<script>parent.location.assign("category.php")</script>'; } } } } function upd_cat() { if(isset($_POST['upd_cat'])) { $title = $_POST['title']; $id = $_GET['id']; $desc = mysql_real_escape_string($_POST['s_desc']); $ob = new database(); if($_FILES['image']['name']) { $target = 'upload/'; $r = rand(0, 123456789); $pic = $target.$r.$_FILES['image']['name']; $ob->query("SELECT * FROM category WHERE id='$id'"); foreach($ob->rows() as $data) { $nn = $data['image']; unlink($nn); } if(move_uploaded_file($_FILES['image']['tmp_name'] , $pic)) { $ob->query("UPDATE category SET title='$title', description='$desc', image='$pic' WHERE id='$id'"); echo '<script>alert("Updated Succesfully")</script>'; echo '<script>parent.location.reload()</script>'; } } else { $ob->query("UPDATE category SET title='$title', description='$desc' WHERE id='$id'"); echo '<script>alert("Updated Succesfully")</script>'; echo '<script>parent.location.reload()</script>'; } } } function upd_subcat() { if(isset($_POST['upd_subcat'])) { $title = $_POST['title']; $id = $_GET['id']; $desc = mysql_real_escape_string($_POST['s_desc']); $ob = new database(); if($_FILES['image']['name']) { $target = 'upload/'; $r = rand(0, 123456789); $pic = $target.$r.$_FILES['image']['name']; $ob->query("SELECT * FROM sub_category WHERE id='$id'"); foreach($ob->rows() as $data) { $nn = $data['image']; unlink($nn); } if(move_uploaded_file($_FILES['image']['tmp_name'] , $pic)) { $ob->query("UPDATE sub_category SET title='$title', description='$desc', image='$pic' WHERE id='$id'"); echo '<script>alert("Updated Succesfully")</script>'; echo '<script>parent.location.reload()</script>'; } } else { $ob->query("UPDATE sub_category SET title='$title', description='$desc' WHERE id='$id'"); echo '<script>alert("Updated Succesfully")</script>'; echo '<script>parent.location.reload()</script>'; } } } function upd_subsubcat() { if(isset($_POST['upd_subsubcat'])) { $title = $_POST['title']; $id = $_GET['id']; $desc = mysql_real_escape_string($_POST['s_desc']); $ob = new database(); if($_FILES['image']['name']) { $target = 'upload/'; $r = rand(0, 123456789); $pic = $target.$r.$_FILES['image']['name']; $ob->query("SELECT * FROM sub_sub_category WHERE id='$id'"); foreach($ob->rows() as $data) { $nn = $data['image']; unlink($nn); } if(move_uploaded_file($_FILES['image']['tmp_name'] , $pic)) { $ob->query("UPDATE sub_sub_category SET title='$title', description='$desc', image='$pic' WHERE id='$id'"); echo '<script>alert("Updated Succesfully")</script>'; echo '<script>parent.location.reload()</script>'; } } else { $ob->query("UPDATE sub_category SET title='$title', description='$desc' WHERE id='$id'"); echo '<script>alert("Updated Succesfully")</script>'; echo '<script>parent.location.reload()</script>'; } } } function add_product() { if(isset($_POST['add_product'])) { $code = $_POST['code']; $title = $_POST['title']; $price = $_POST['price']; $color = count($_POST['color']); $size = $_POST['size']; $type = $_POST['type']; $cat = $_POST['abc']; $tt = explode('.', $cat); $tt[0]; $tt[1]; $s_desc = mysql_real_escape_string($_POST['s_desc']); $l_desc = mysql_real_escape_string($_POST['l_desc']); $ob = new database(); if($_FILES['image']['name']) { $target = 'upload/'; if(!is_dir($target)) { mkdir($target); } $c = count($_FILES['image']['name']); for($i=0; $i<$c; $i++) { $r = rand(0, 123456789); $pic = $target.$r.$_FILES['image']['name'][$i]; if((move_uploaded_file($_FILES['image']['tmp_name'][$i], $pic))) { $ob = new database(); $ob->query("INSERT INTO product_image SET code='$code', image='$pic'"); //echo '<script>alert("Data Successfully Inserted.")</script>'; //echo '<script>parent.jQuery.fancybox.close()</script>'; //echo '<script>parent.location.reload();</script>'; } } } if($tt[0] == 'category') { for($i=0; $i<$color; $i++) { $cc = $_POST['color'][$i]; $zz = $_POST['size'][$i]; $rr = $_POST['price'][$i]; $ob->query("INSERT INTO product SET cat_id='$tt[1]', code='$code', name='$title', price='$rr', description='$l_desc', s_desc='$s_desc', color='$cc', size='$zz'"); } $n = mysql_insert_id(); if($n) { echo '<script>alert("Added Succesfully.\n")</script>'; } else { echo '<script>alert("Error.\n")</script>'; } } elseif($tt[0] == 'sub_category') { for($i=0; $i<$color; $i++) { $cc = $_POST['color'][$i]; $zz = $_POST['size'][$i]; $rr = $_POST['type'][$i]; $ob->query("INSERT INTO product SET sub_id='$tt[1]', code='$code', name='$title', type='$rr', description='$l_desc', s_desc='$s_desc', color='$cc', size='$zz'"); } $n = mysql_insert_id(); if($n) { echo '<script>alert("Product Added Succesfully.\n")</script>'; echo '<script>parent.location.assign("product.php")</script>'; } else { echo '<script>alert("Error.\n")</script>'; } } elseif($tt[0] == 'sub_sub_category') { for($i=0; $i<$color; $i++) { $cc = $_POST['color'][$i]; $zz = $_POST['size'][$i]; $rr = $_POST['type'][$i]; $ob->query("INSERT INTO product SET sub_sub_id='$tt[1]', code='$code', name='$title', type='$rr', description='$l_desc', s_desc='$s_desc', color='$cc', size='$zz'"); } $n = mysql_insert_id(); if($n) { echo '<script>alert("Added Succesfully.\n")</script>'; } else { echo '<script>alert("Error.\n")</script>'; } } } } function add_product_image() { if(isset($_POST['add_product_image'])) { $code = $_GET['code']; if($_FILES['image']['name']) { $target = 'upload/'; if(!is_dir($target)) { mkdir($target); } $c = count($_FILES['image']['name']); for($i=0; $i<$c; $i++) { $r = rand(0, 123456789); $pic = $target.$r.$_FILES['image']['name'][$i]; if((move_uploaded_file($_FILES['image']['tmp_name'][$i], $pic))) { $ob = new database(); $ob->query("INSERT INTO product_image SET code='$code', image='$pic'"); echo '<script>alert("Images Successfully Added.")</script>'; //echo '<script>parent.jQuery.fancybox.close()</script>'; echo '<script>parent.location.assign("edit_img.php?code='.$_GET['code'].'");</script>'; } } } } } function upd_product_price() { if(isset($_POST['upd_product_price'])) { //$code = $_POST['code']; $id = $_GET['id']; //$title = $_POST['title']; $type = $_POST['type']; $color = $_POST['color']; $size = $_POST['size']; //$cat = $_POST['abc']; //$s_desc = mysql_real_escape_string($_POST['s_desc']); //$l_desc = mysql_real_escape_string($_POST['l_desc']); $ob = new database(); $ob->query("UPDATE product SET type='$type', color='$color', size='$size' WHERE id='$id'"); echo '<script>alert("Updated Succesfully.\n")</script>'; echo '<script>parent.location.reload()</script>'; } } function upd_product() { if(isset($_POST['upd_product'])) { $code = $_POST['code']; $id = $_GET['id']; $title = $_POST['title']; //$type = $_POST['type']; //$cat = $_POST['abc']; $s_desc = mysql_real_escape_string($_POST['s_desc']); $l_desc = mysql_real_escape_string($_POST['l_desc']); $ob = new database(); $ob->query("UPDATE product SET name='$title', description='$l_desc', s_desc='$s_desc' WHERE code='$code'"); echo '<script>alert("Updated Succesfully.\n")</script>'; echo '<script>parent.location.reload()</script>'; } } ?>