file_get_contents
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u247928417
/
domains
/
riddi.in
/
public_html
/
admin
/
Filename :
product_old.php
back
Copy
<?php include ("session/session.php"); include ("config/config.php"); $num_rec_per_page = 100; if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page = 1; }; $start_from = ($page - 1) * $num_rec_per_page; $product_images = "SELECT interface_product.product_name,interface_product.product_status, interface_inventory.product_stock,interface_product.product_id,img_1 FROM interface_product LEFT JOIN `interface_product_images` ON `interface_product_images`.product_id = interface_product.product_id LEFT JOIN interface_inventory ON interface_inventory.product_id = interface_product.product_id ORDER BY product_name ASC LIMIT " . $start_from . "," . $num_rec_per_page; $product_images_result =mysqli_query($conn,$product_images) or die(mysqli_error()); $product_images_row = mysqli_num_rows($product_images_result); $productCount = "SELECT count(*) as count_result FROM interface_product"; $productResCount =mysqli_query($conn,$productCount) or die(mysqli_error()); $proDataCount = mysqli_fetch_assoc($productResCount); if (isset($_REQUEST['productAct']) && !empty($_REQUEST['productAct']) && isset($_REQUEST['Act']) && !empty($_REQUEST['Act'])) { $updateAct = "UPDATE `interface_product` SET `product_status`='" . $_REQUEST['Act'] . "' WHERE `product_id` = '" . $_REQUEST['productAct'] . "'"; $updateActRes =mysqli_query($conn,$updateAct) or die(mysqli_error()); echo "<meta http-equiv='refresh' content='0; url=product'/>"; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>:: Admin :: Modern Bazaar ::</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" /> <link href="css/tab-form.css" rel="stylesheet" type="text/css" /> <link href="css/font-awesome.css" rel="stylesheet"> <link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet"> <link href="css/style.css" rel="stylesheet" type="text/css"> <link href="css/pages/signin.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="assets/images/icon.jpg"> <script type='text/javascript' src='js/add-more.js'></script> <script type='text/javascript' src='js/jquery-1.10.1.js'></script> <script type='text/javascript' src="js/jquery.validate.js"></script> <script type='text/javascript' src="js/validation.js"></script> <script type='text/javascript' src="js/bootstrap.min.js"></script> <script type='text/javascript' src="js/hide-show-effect.js"></script> <script src="ckeditor/ckeditor.js"></script> <script> $(document).ready(function () { $('[data-toggle="tooltip"]').tooltip(); }); </script> <!-- date picker --> <script type='text/javascript' src="date/jquery.min.js"></script> <script src="date/ui.datepicker.js"></script> <link type="text/css" rel="stylesheet" href="date/ui.datepicker.css"/> <script type="text/javascript" charset="utf-8"> jQuery(function ($) { $.datepicker.setDefaults({showOn: 'both', buttonImageOnly: true, buttonImage: './date/calendar.gif', buttonText: 'Calendar'}); $("#new_date").datepicker({dateFormat: 'dd-mm-yy'}); }); </script> <!-- date picker --> <!-- time picker --> <script type="text/javascript" src="date/jquery.timePicker.js"></script> <link rel="stylesheet" type="text/css" href="date/timePicker.css"/> <script type="text/javascript"> jQuery(function () { $("#StartTime").timePicker({ startTime: "09:00", // Using string. Can take string or Date object. endTime: new Date(0, 0, 0, 23, 30, 0), // Using Date object. show24Hours: false, separator: ':', step: 01}); $("#EndTime").timePicker({ startTime: "09:00", // Using string. Can take string or Date object. endTime: new Date(0, 0, 0, 23, 30, 0), // Using Date object. show24Hours: false, separator: ':', step: 01}); }); </script> <!-- time picker --> <!-- java script used to display category check box tree --> <script type='text/javascript' src="js/jquery.deepcheckbox.js"></script> <!-- java script used to display category check box tree --> <script> $.noConflict(); </script> <!-- date picker --> <script language="JavaScript" type="text/javascript"> function checkdelete() { var r = confirm("Are you sure to delete?"); if (r == true) { return true; } else { return false; } } function checkActive() { var r = confirm("Are you sure you want to active?"); if (r == true) { return true; } else { return false; } } function checkInactive() { var r = confirm("Are you sure you want to Inactive?"); if (r == true) { return true; } else { return false; } } </script> <script> $(document).ready(function (e) { $("#uploadAjaxImage").on('submit', (function (e) { e.preventDefault(); $("#message").empty(); $('#loading').show(); $.ajax({ url: "ajax_upload_file.php", // Url to which the request is send type: "POST", // Type of request to be send, called as method data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values) contentType: false, // The content type used when sending data to the server. cache: false, // To unable request pages to be cached processData: false, // To send DOMDocument or non processed data file it is set to false success: function (data) // A function to be called if request succeeds { $('#loading').hide(); $("#message").html(data); } }); })); // Function to preview image after validation $(function () { $("#file").change(function () { $("#message").empty(); // To remove the previous error message var file = this.files[0]; var imagefile = file.type; var match = ["image/jpeg", "image/png", "image/jpg"]; if (!((imagefile == match[0]) || (imagefile == match[1]) || (imagefile == match[2]))) { $('#previewing').attr('src', 'noimage.png'); $("#message").html("<p id='error'>Please Select A valid Image File</p>" + "<h4>Note</h4>" + "<span id='error_message'>Only jpeg, jpg and png Images type allowed</span>"); return false; } else { var reader = new FileReader(); reader.onload = imageIsLoaded; reader.readAsDataURL(this.files[0]); } }); }); function imageIsLoaded(e) { $("#file").css("color", "#FFFFFF"); $('#image_preview').css("display", "block"); $('#previewing').attr('src', e.target.result); $('#previewing').attr('width', '250px'); $('#previewing').attr('height', '230px'); } ; }); </script> <script type="text/javascript"> $(document).ready(function () { var maxField = 10; //Input fields increment limitation var addButton = $('.add_button'); //Add button selector var wrapper = $('.field_wrapper'); //Input field wrapper var fieldHTML = '<div style="margin-top:5px;"><input type="text" class="span1 disabled" placeholder="Price" name="p_price[]" id="p_price"/><label id="p_price-val"></label> <input type="text" class="span2 disabled" placeholder="Weight/Pieces" name="p_weight[]" id="p_weight"/><label id="p_price-val"></label> <input type="text" class="span2 disabled" name="ps_price[]" placeholder="Special Price" id="ps_price"/> <select id="tax_class" name="tax_class[]"><option value="None"> None </option><option value="Taxable Goods"> Taxable Goods </option><option value="Shipping"> Shipping </option></select><span id="span-p_weight"></span><label id="p_weight-val"></label><input type="text" class="span2 disabled" placeholder="Discount (%)" name="p_discount[]" id="store_name"/> <a href="javascript:void(0);" class="remove_button" title="Remove field"><i class="icon-minus-sign"></i></a><div>'; //New input field html var x = 1; //Initial field counter is 1 $(addButton).click(function () { //Once add button is clicked if (x < maxField) { //Check maximum number of input fields x++; //Increment field counter $(wrapper).append(fieldHTML); // Add field html } }); $(wrapper).on('click', '.remove_button', function (e) { //Once remove button is clicked e.preventDefault(); $(this).parent('div').remove(); //Remove field html x--; //Decrement field counter }); }); </script> <style> .active_pro { color:#0F0; } .inactive_pro { color:#F00; } </style> <script type='text/javascript' src="js/autosuggestion.js"></script> <style> *{margin:0;padding:0;} .autodropdown{position:absolute;top:35px;left:-20px;z-index: 100} .autodropdown_2{position:absolute;top:30px;left:-25px;z-index: 100} .abhijitscript{ padding:4px; border:1px solid #333; } .suggestresult{ width:360px; list-style:none; } .suggestresult_2{ width:210px; list-style:none; } .suggestresult li{ padding:5px; border:1px solid #333; border-top:0; cursor:pointer; background:#333; color:#fff; border-bottom:1px solid #666; } .suggestresult_2 li{ padding:5px; border:1px solid #333; border-top:0; cursor:pointer; background:#333; color:#fff; border-bottom:1px solid #666; } .suggestresult li:hover{ background:#666; color:#ffffff; cursor:pointer; } .suggestresult_2 li:hover{ background:#666; color:#ffffff; cursor:pointer; } </style> </head> <body> <?php include './panel-files/header.php'; include './panel-files/menu.php'; ?> <!-- /subnavbar --> <div class="main"> <div class="main-inner"> <div class="container"> <div class="row"> <div class="span1" style="width:139px;"> <div class="widget widget-nopad"> <div class="widget-header"> <i class=" icon-plus-sign"></i> <a href="add-product"><h2>Add Product</h2></a> </div> </div> </div> <div class="span5" > <div class="widget widget-nopad" style="width:419px;"> <form action="resultp" method="post"> <input placeholder="Search Product Name" required type="text" style="width:360px;" class="searchscript" name="search" /> <input type="submit" name="searchInfo" value="Search" /> <div class="autodropdown"> <ul class="suggestresult"></ul> </div> </form> </div> </div> <div class="span4"> <div class="widget widget-nopad" style="width: 277px;margin-left: -73px;"> <form action="resultp" method="post"> <input placeholder="Search En-Code Wise" required type="text" style="width:200px;" name="encode_search" /> <input type="submit" name="searchInfo" value="En-Search" /> </form> </div> </div> <div class="span1" style="margin-left:-100px;"> <div class="widget widget-nopad"> <?php require_once './excel.php'; ?> </div> </div> <div class="span12" style="text-align: center"> <?php if (isset($message)) { ?> <b class="message_true"> <?php echo $message; ?></b> <?php } if (isset($errormsg)) { ?> <b class="message_false"> <?php echo $errormsg; echo '<p style="color:#666;">We will be redirected with in 10 Seconds ....<p>'; ?></b> <?php } ?> </div> <div class="span12"> <div class="widget widget-nopad"> <div class="widget-header"> <i class="icon-list-alt"></i> <h3> Added Product Information </h3> <span class="count_product"> <?php echo '( Total Product : ' . $proDataCount['count_result'] . ')'; ?> </span> <h3 style="float: right;margin-top:4px;"> <form action="resultC" method="post"> <input placeholder="Search Department Name" required type="text" style="width:190px;" class="searchscript_2" name="search_2" /> <select name="status" style="width:80px;"> <option value="Enable">Enable</option> <option value="Disable">Disable</option> </select> <input type="submit" name="searchInfo_2" value="Search" /> <div class="autodropdown_2"> <ul class="suggestresult_2"></ul> </div> </form> </h3> </div> <div class="widget-content"> <div class="widget big-stats-container"> <div class="widget-content"> <?php $sql = "SELECT * FROM interface_product"; $rs_result =mysqli_query($conn,$sql); //run the query $total_records = mysqli_num_rows($rs_result); //count number of records $total_pages = ceil($total_records / $num_rec_per_page); echo "<a href='#' class='pagination'>" . '←' . "</a> "; // Goto 1st page for ($i = 1; $i <= $total_pages; $i++) { echo " <a href='?page=" . $i . "' class='pagination'>" . $i . "</a> "; }; echo "<a href='?page=$total_pages' class='pagination'>" . '→' . "</a> "; // Goto last page ?> <table class="table table-striped table-bordered"> <thead> <tr> <th> S No. </th> <th> Product Images</th> <th> Product Name </th> <th> Inventory</th> <th> Status</th> <th class="td-actions" width="10%"> Action </th> </tr> </thead> <tbody> <?php $i = 1; if ($product_images_row) { while ($product_data = mysqli_fetch_assoc($product_images_result)) { if ($product_data['product_status'] == 'Disable') { $product_status = 'Disable'; } else { $product_status = 'Enable'; } if ($product_data['product_stock'] == 0) { $prostock = 'Out of Stock'; } else { $prostock = 'In Stock'; } $url = explode('.', $product_data['img_1']); if (file_exists("upload/$url[0].jpg")) { $img = 'upload/' . $url[0] . '.jpg'; } else if (file_exists("upload/$url[0].JPG")) { $img = 'upload/' . $url[0] . '.JPG'; } else if (file_exists("upload/$url[0].jpeg")) { $img = 'upload/' . $url[0] . '.jpeg'; } else if (file_exists("upload/$url[0].JPEG")) { $img = 'upload/' . $url[0] . '.JPEG'; } else if (file_exists("upload/$url[0].png")) { $img = 'upload/' . $url[0] . '.png'; } else if (file_exists("upload/$url[0].PNG")) { $img = 'upload/' . $url[0] . '.PNG'; } else { $img = 'upload/default.png'; } ?> <tr> <td><?php echo $i; ?></td> <td><img src="<?php echo $img; ?>" height="100" width="100" /></td> <td><?php echo $product_data['product_name']; ?></td> <td><?php echo $prostock; ?></td> <td><?php echo $product_status; ?></td> <td > <a href="edit-single-product?product_id=<?php echo $product_data['product_id']; ?>" data-toggle="tooltip" title="Edit Product"/> Edit</a> / <?php if ($product_data['product_status'] == 'Enable') { ?> <a href="product?productAct=<?php echo $product_data['product_id']; ?>&Act=Disable" data-toggle="tooltip" title="Active Product" class="active_pro" onClick="return checkInactive();"> <?php echo $product_data['product_status']; ?></a> <?php } else if ($product_data['product_status'] == 'Disable') { ?> <a href="product?productAct=<?php echo $product_data['product_id']; ?>&Act=Enable" data-toggle="tooltip" title="Inactive Product" class="inactive_pro" onClick="return checkActive();"> <?php echo $product_data['product_status']; ?></a> <?php } ?> </td> </tr> <?php $i++; } } else { echo '<tr ><td colspan="9" style="text-align:center;">'; echo 'No Product !</td></tr>'; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <!-- /container --> </div> <!-- /main-inner --> </div> <?php include('panel-files/footer.php');?> <div class="footer-inner"> <div class="container"> <div class="row"> <div class="span12"> © 2015 <a href="http://www.netnivaran.com/">NetNivaran</a> </div> <!-- /span12 --> </div> <!-- /row --> </div> <!-- /container --> </div> <!-- /footer-inner --> </div> <script src="js/jquery-1.7.2.min.js"></script> <script src="js/bootstrap.js"></script> <script src="js/base.js"></script> </body> </html>