<?php
  session_start();
  if(!isset($_SESSION['LOGIN_STATUS']))
  {
      header('location:../index.php');
  }
  require "../model/configuration.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><?php echo $_SESSION['title'];?></title>
<link rel='stylesheet' type='text/css' href='../css/fonts.googleapis.com/css_cd14c140.css' />
<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="../vendor/bootstrap/css/bootstrap.min.css" />
<!-- Theme CSS -->
<link rel="stylesheet" type="text/css" href="../css/vendor.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" type="text/css" href="../css/utility.css" />
<link rel="stylesheet" type="text/css" href="../css/custom.css" />
</head>

<body class="dashboard-page">
<script> var boxtest = localStorage.getItem('boxed'); if (boxtest === 'true') {document.body.className+=' boxed-layout';} </script> 
<!-- Start: Theme Preview Pane -->


<!-- Start: Header -->
<header class="navbar navbar-fixed-top">
  
   <?php include_once("../include/top_menu.php");?> 
</header>

<!-- Start: Main -->
<div id="main"> 
  
  <!-- Start: Sidebar -->
  <?php include_once("../include/left_menu.php");?>

  <!-- Start: Content -->
  <section id="content_wrapper">
    <div id="topbar">
      <div class="topbar-left">
        <ol class="breadcrumb">
          <li class="crumb-icon"><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
          <li class="crumb-link"><a href="#">Product</a></li>
          <li class="crumb-trail">Product Add</li>
        </ol>
      </div>
      
    </div>
    
    
    <div id="content">
      <div class="row">
        <div class="col-md-4">
          <div class="panel">
            <div class="panel-heading"> <span class="panel-title"> <span class="glyphicon glyphicon-lock"></span> Product Add </span> </div>
            <div class="panel-body">
              <form class="cmxform form-horizontal" id="altForm" action="../controler/add_products.php" role="form" method="post" autocomplete="off">
              
              
              <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">Product Code</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                      <input id="prdcode" name="prdcode" type="text" class="form-control" placeholder="Product Code" required="" autocomplete="off" />
                    </div>
                  </div>
                </div>
                
                
                
                
                
                
                <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">Product Name</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                      <input id="prdname" name="prdname" type="text" class="form-control" placeholder="Product Name" required="" autocomplete="off" />
                    </div>
                  </div>
                </div>
                
                <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">GSM</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                      <input id="gsm" name="gsm" type="text" class="form-control" placeholder="GSM" autocomplete="off" />
                    </div>
                  </div>
                </div>
                
                
                <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">Paper Type</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                    <select class="form-control" id="papertype" name="papertype" >
                   <option value="">--Select--</option>
                    <?php
		
        $cusqury=$db->execute("select * from paper_type where del='0'");
		while($curesult=$cusqury->fetch_assoc())
			{
				
		?>
        <option value="<?php echo $curesult['papertype'];?>"><?php echo $curesult['papertype'];?></option>
        <?php
			}
		?>

   
                      </select>
                    
                    
                    </div>
                  </div>
                </div>
                
                
                
                <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">Paper Color</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                      <input id="papercolor" name="papercolor" type="text" class="form-control" placeholder="Paper Color"  autocomplete="off" />
                    </div>
                  </div>
                </div>
                
                
                
                <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">Paper Size</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                      <input id="papersize" name="papersize" type="text" class="form-control" placeholder="Paper Size"  autocomplete="off" />
                    </div>
                  </div>
                </div>
                
                
                
               
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                <div class="form-group">
                  <label for="cp" class="col-lg-3 control-label">Sellable Price</label>
                  <div class="col-lg-9">
                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-hand-o-right"></i></span>
                      <input id="prdname" name="sellprice" type="text" class="form-control" placeholder="Sellable Price" required="" autocomplete="off" />
                    </div>
                  </div>
                </div>
                
                
                
                
     
            
                <div class="form-group">
                <div class="col-lg-11">
                  <input class="submit btn bg-purple pull-right" name="prdct_add" type="submit" value="Submit" />
                  </div>
                </div>
              </form>
            </div>
          </div>
          </div>
          
          <div class="col-md-8">
          <div class="panel">
            <div class="panel-heading"> <span class="panel-title"> <span class="glyphicon glyphicon-pencil"></span> Products </span> </div>
            <div class="panel-body pbn">
              <table class="table table-striped table-bordered table-hover" id="datatable">
                <thead>
                  <tr>
                    <th>#</th>
                    <th>Product Code</th>
                    <th>Product Name</th>
                    <th>GSM</th>
                    <th>Paper Type</th>
                    <th>Paper Color</th>
                    <th>Paper Size</th>
                    <th>Sellable Price</th>
                    <th class="text-center hidden-xs">Actions</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
				  $c=0;
                  $sqry=$db->execute("select * from products where delet='0'");
				  while($row=$sqry->fetch_assoc())
				  {
					  $c++;
				  ?>
                  <tr>
                    <td><?php echo $c;?></td>
                    <td class="hidden-xs"><?php echo $row['productcode'];?></td>
                    <td class="hidden-xs"><?php echo $row['productname'];?></td>
                    <td class="hidden-xs"><?php echo $row['gsm'];?></td>
                    <td class="hidden-xs"><?php echo $row['paper_type'];?></td>
                    <td class="hidden-xs"><?php echo $row['paper_color'];?></td>
                    <td class="hidden-xs"><?php echo $row['paper_size'];?></td>
                    <td class="hidden-xs"><?php echo $row['sellprice'];?></td>
                    <td class="hidden-xs text-center"><a href="product_edit.php?id=<?php echo $row['id'];?>" title="Edit"><i class="fa fa-pencil"></i></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="../controler/product_delet.php?id=<?php echo $row['id'];?>" title="Delete"><i class="fa fa-trash-o"></i></a></td>
                  </tr>
                  <?php
				  }
				  ?>
                </tbody>
              </table>
            </div>
          </div>
          
          
          
          
          
          
          
          
          
          
          
          
          </div>
          </div>
          
    
    
    
    
    
    
    
    
    
      <?php //include_once("dashboard_content.php");?>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    </div>
    
  </section>
  
  <!-- Start: Right Sidebar -->
  
</div>
<!-- End #Main --> 


<!-- jQuery --> 
<script type="text/javascript" src="../vendor/jquery/jquery-1.11.1.min.js"></script> 
<script type="text/javascript" src="../vendor/jquery/jquery_ui/jquery-ui.min.js"></script> <!-- Bootstrap --> 
<script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script> 

<!-- Page Plugins --> 
<script type="text/javascript" src="../vendor/plugins/validate/jquery.validate.js"></script>  
<script type="text/javascript" src="../vendor/plugins/morris/morris.js"></script> 
<script type="text/javascript" src="../vendor/plugins/datatables/js/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="../vendor/plugins/datatables/js/datatables.js"></script> 
<script type="text/javascript" src="../vendor/plugins/multiselect/bootstrap-multiselect.js"></script> 
<script type="text/javascript" src="../vendor/plugins/jvectormap/jquery-jvectormap.min.js"></script> 
<script type="text/javascript" src="../vendor/plugins/jvectormap/assets/jquery-jvectormap-us-lcc-en.js"></script> 
<script type="text/javascript" src="../vendor/plugins/clndr/clndr.js"></script> 
<script type="text/javascript" src="../vendor/plugins/clndr/moment.js"></script> 
<script type="text/javascript" src="../vendor/plugins/datepicker/bootstrap-datepicker.js"></script> 
<script type="text/javascript" src="../vendor/plugins/jquerymask/jquery.maskedinput.min.js"></script> 
<!-- Flot Plugins --> 
<script type="text/javascript" src="../vendor/plugins/jqueryflot/jquery.flot.min.js"></script> 

<!-- Theme Javascript --> 
<script type="text/javascript" src="../js/utility/spin.min.js"></script> 
<script type="text/javascript" src="../js/utility/underscore-min.js"></script> 
<script type="text/javascript" src="../js/main.js"></script> 
<script type="text/javascript" src="../js/ajax.js"></script> 
<script type="text/javascript" src="../js/custom.js"></script> 
<script type="text/javascript">
jQuery(document).ready(function () {
	  
	 "use strict";

     // Init Theme Core 	  
     Core.init();

     // Enable Ajax Loading 	  
     Ajax.init();     
     
	 
	 	
	 // validate the comment form when it is submitted
	 $("#altForm").validate();

	 //Init jquery Date Picker
	 $('.datepicker').datepicker()
	 
	 $('#datatable').dataTable( {
	"aoColumnDefs": [{ 'bSortable': false, 'aTargets': [ -1 ] }],
	"oLanguage": { "oPaginate": {"sPrevious": "", "sNext": ""} },
	"iDisplayLength": 5,
	"aLengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
	"sDom": 'T<"panel-menu dt-panelmenu"lfr><"clearfix">tip',
	"oTableTools": {
		"sSwfPath": "./vendor/plugins/datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
	}
  });	
  
  // Add Placeholder text to datatables filter bar
  $('.dataTables_filter input').attr("placeholder", "Enter Filter Terms Here....");
  
  // Manually Init Chosen on Datatables Filters
  $("select[name='datatable_length']").chosen();	
	
});
</script>
</body>
</html>
<?php
if(isset($_GET['msg']) && $_GET['msg']!= NULL)
{
?>
<script>
alert("<?php echo $_GET['msg'];?>");
</script>
<?php
}
?>