<?php
error_reporting(0);
ob_start();
session_start();
include_once("../dbconnect.php");
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
     <style type="text/css">

      /* Sticky footer styles
      -------------------------------------------------- */

     

    </style>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">

<?php include_once("title.php"); ?>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/logo-nav.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
     <div id="wrap">
    <!-- Navigation -->
       <?php include_once("header.php"); ?>

    <!-- Page Content -->
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
<?php
$farooq1=mysql_query("select * from mec_categories");$i=1;
				$pasha1=mysql_fetch_array($farooq1);
?>
                 
                <br> <br> <br>
                <h1 style="text-align: center;"><?php echo $pasha1['mec_catname']; ?></h1>

                <div class="row">
        <div class="col-lg-12">
     



<form class="form-horizontal">
<fieldset>

<!-- Form Name -->
<legend style="text-align: center">Form Name</legend>

<!-- Text input-->
<div class="form-group">
  <label class="col-md-4 control-label" for="textinput">Text Input</label>  
  <div class="col-md-4">
  <input id="textinput" name="textinput" type="text" placeholder="placeholder" class="form-control input-md">
    
  </div>
</div>

    <!-- Select Basic -->
<div class="form-group">
  <label class="col-md-4 control-label" for="selectbasic">Select Basic</label>
  <div class="col-md-4">
    <select id="selectbasic" name="selectbasic" class="form-control">
      <option value="1">Option one</option>
      <option value="2">Option two</option>
    </select>
  </div>
</div>

<!-- Multiple Checkboxes (inline) -->
<div class="form-group">
  <label class="col-md-4 control-label" for="checkboxes">Inline Checkboxes</label>
  <div class="col-md-4">
    <label class="checkbox-inline" for="checkboxes-0">
      <input type="checkbox" name="checkboxes" id="checkboxes-0" value="1">
      1
    </label>
    <label class="checkbox-inline" for="checkboxes-1">
      <input type="checkbox" name="checkboxes" id="checkboxes-1" value="2">
      2
    </label>
    <label class="checkbox-inline" for="checkboxes-2">
      <input type="checkbox" name="checkboxes" id="checkboxes-2" value="3">
      3
    </label>
    <label class="checkbox-inline" for="checkboxes-3">
      <input type="checkbox" name="checkboxes" id="checkboxes-3" value="4">
      4
    </label>
  </div>
</div>

<!-- Multiple Radios (inline) -->
<div class="form-group">
  <label class="col-md-4 control-label" for="radios">Inline Radios</label>
  <div class="col-md-4"> 
    <label class="radio-inline" for="radios-0">
      <input type="radio" name="radios" id="radios-0" value="1" checked="checked">
      1
    </label> 
    <label class="radio-inline" for="radios-1">
      <input type="radio" name="radios" id="radios-1" value="2">
      2
    </label> 
    <label class="radio-inline" for="radios-2">
      <input type="radio" name="radios" id="radios-2" value="3">
      3
    </label> 
    <label class="radio-inline" for="radios-3">
      <input type="radio" name="radios" id="radios-3" value="4">
      4
    </label>
  </div>
</div>



<!-- File Button --> 
<div class="form-group">
  <label class="col-md-4 control-label" for="filebutton" style="margin-top: 5%;">Add Image</label>
  <div class="col-md-4" style="margin-top: 5%;">
    <input id="filebutton" name="filebutton" class="input-file btn btn-danger" type="file" style="vertical-align: central">
  </div>
    <div class="col-md-4">
 <img src="http://placehold.it/200x150">
  </div>
</div>



<!-- Textarea -->
<div class="form-group">
  <label class="col-md-4 control-label" for="textarea">Text Area</label>
  <div class="col-md-4">                     
    <textarea class="form-control" id="textarea" name="textarea">default text</textarea>
  </div>
</div>

    <!-- Button -->
<div class="form-group">
  <label class="col-md-4 control-label" for="singlebutton"></label>
  <div class="col-md-4">
    <button id="singlebutton" name="singlebutton" class="btn btn-primary">Button</button>
  </div>
</div>

</fieldset>
</form>


        </div>
    </div>

<?php
if($_GET['action']=="update")
{
?>
  <?php
					$update=mysql_query("select * from mec_subcategories where mec_subcatid=".$_GET['mec_subcatid']);
				$update1=mysql_fetch_array($update);
					?>
                <div class="row">
        <div class="col-lg-12">
        <form class="form-horizontal" action="subcategoryins.php?action=edit" method="post" enctype="multipart/form-data">
<fieldset>

<!-- Form Name -->
<legend>Add New Image</legend>

<!-- File Button --> 
<div class="form-group">
  <label class="col-md-6 control-label" style="float: left" for="Image">Image :</label>
  <div class="col-md-6"><input id="Image" name="mec_subcatimage" class="input-file" type="file"><img src="../products/subcategory/<?php echo $update1['mec_subcatid'];?>.jpg" style="width:50px; height:50px;">
</div><br> <br>
    <div class="clearfix"></div>
  <label class="col-md-6 control-label" style="float: left" for="Image">Name :</label>
  <div class="col-md-6"><input id="Image" name="mec_subcatname" value="<?php echo $update1['mec_subcatname']; ?>" class="input-file" type="text"></div>

    <br>
     <br>
    <div class="clearfix"></div>

  <label class="col-md-6 control-label" style="float: left" for="Image">Description :</label>
  <div class="col-md-6"><textarea id="Image" name="mec_subcatdes" class="input-file"><?php echo $update1['mec_subcatdes']; ?></textarea></div>
  <br>
  <br>
  <input type="submit" style="margin-left: auto; margin-right: auto; display: block;" class="btn btn-primary btn-lrg" value="Submit"/>
</div>
<input type="hidden" name="mec_subcatid" value="<?php echo $update1['mec_subcatid']; ?>">
<input type="hidden" name="mec_catid" value="<?php echo $update1['mec_catid']; ?>">

</fieldset>
</form>
        </div>
    </div>
<?php } ?>
                <div class="row">
            <div class="col-lg-12">

               <a href="subcategory.php?action=addnew&mec_catid=<?php echo $_GET['mec_catid']; ?>"><button style="float: right" class="btn btn-primary btn-lg"><span class="glyphicon glyphicon-plus-sign"></span> Add New Sub Category</button></a>

                <table class="table table-striped table-condensed">
                  <thead><tr><th>S No.</th><th style="text-align: left;">Sub Category Name</th><th>Action</th></tr></thead>
                    
                    <tbody>
                    <?php
					$subfarooq=mysql_query("select * from mec_subcategories where mec_catid=".$_GET['mec_catid']);$i=1;
					while($subpasha=mysql_fetch_array($subfarooq))
					{
					?>
                    <tr>
                        <td style="vertical-align: middle;"><?php echo $i; ?></td>
                        <td style="text-align: left"><a href="#"><i class="fa fa-folder fa-2x" aria-hidden="true"></i>
<?php echo $subpasha['mec_subcatname'];?></a></td>
                        <td style="vertical-align: middle;"><a href="subcategory.php?action=update&mec_catid=<?php echo $subpasha['mec_catid']; ?>&mec_subcatid=<?php echo $subpasha['mec_subcatid'];?>"><button class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-edit"></span> Edit</button> </a><a href="subcategoryins.php?action=delete&mec_catid=<?php echo $subpasha['mec_catid']; ?>&mec_subcatid=<?php echo $subpasha['mec_subcatid']; ?>"><button class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete</button></a> 
                        <?php if($subpasha['mec_subcat_status']==1){ ?>
                        <a href="subcategoryins.php?action=status&mec_catid=<?php echo $subpasha['mec_catid']; ?>&mec_subcatid=<?php echo $subpasha['mec_subcatid']; ?>&mec_subcat_status=0">
                        <button class="btn btn-success btn-sm active"><span class="glyphicon glyphicon-ok"></span> Active</button></a>
                        <?php } ?>
                        <?php if($subpasha['mec_subcat_status']==0){ ?>
                         <a href="subcategoryins.php?action=status&mec_catid=<?php echo $subpasha['mec_catid']; ?>&mec_subcatid=<?php echo $subpasha['mec_subcatid']; ?>&mec_subcat_status=1">
                         <button class="btn btn-danger btn-sm disabled"><span class="glyphicon glyphicon-remove"></span> Disable</button>
                         </a>
                          <?php } ?>
                         </td>
                    </tr>
                    <?php $i++; } ?>
                        
                   <!-- <tr>
                        <td>cell is row 1, column 0</td><td>cell is row 1, column 1</td><td>cell is row 1, column 2</td>
                    </tr>
                        
                    <tr>
                        <td>cell is row 2, column 0</td><td>cell is row 2, column 1</td><td><button class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-edit"></span> Edit</button> <button class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete</button> <button class="btn btn-success btn-sm active"><span class="glyphicon glyphicon-ok"></span> Active</button> <button class="btn btn-default btn-sm disabled"><span class="glyphicon glyphicon-remove"></span> Disable</button></td>
                    </tr>-->
                    </tbody>
                </table>
                <br><br>
                <a href="category.php"><button style="float: left" class="btn btn-primary btn-lg"> << Back </button></a>
                </div></div>
                <br>

                
               
    </div>

        </div>

  

            </div>
            
         <div id="push"></div>
    </div>

     <?php include_once("footer.php"); ?>
   

    
    <!-- /.container -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>


</body>

</html>
