Example #1
0
 public static function getInstance()
 {
     if (!self::$category instanceof self) {
         self::$category = new self();
     }
     return self::$category;
 }
Example #2
0
				</div>
			</form>	
				<div class='get_all_category col-md-12 table-responsive'>
					<table class="table table-hover">
			    		<thead>
						<tr>
							<th>ID</th>
							<th>Name</th>
							<th>Number of products</th>
							<th>Action</th>
						</tr>
						<tr><th colspan="4">Categories With Products</th></tr>
						</thead>
						<tbody>
							<?php 
$cats = $cat->category();
foreach ($cats as $key => $category) {
    $id = $category['id'];
    echo "<tr><td> " . $id;
    echo "</td><td class='name'>" . $category['name'] . "</td>";
    echo "<td class='edit' class='hide'>";
    echo "<form  role='form' class='form-horizontal col-md-5' action='module/server.php' method='post'>";
    echo "<input placeholder='" . $category['name'] . "' class='form-control' id='add_cat' style='width:120px;height:35px; margin:-10px 0px'/><input type='submit' class=' btn btn-primary btn-lg' name='ok' value='submit edit' style='width:120px;height:40px;position:absoulte;margin:0px 130px; margin-top:-35px'/>";
    echo "<input  name='method' class='col-md-1 btn btn-primary btn-lg' value='edit' type='hidden' ></form>";
    echo "</td>";
    echo "</td><td>" . $category['Products'] . "</td>";
    echo "<td><div class='btn-group btn-group-sm'><a class='btn btn-warning' class='show_edit' value='Add new Category' >edit name</a>";
    echo "<a  class='btn btn-danger' href='module/server.php?method=delete&id=" . $id;
    echo "'>Delete</a></div></td></tr>";
}
?>