Пример #1
0
	
	<ul class="breadcrumb">
	    <li><a href="#">Home</a></li>
	    <li><a href="view_branch_table.php">Tables</a></li>
	    <li><a class="active" href="#" >Add</a></li>
	</ul>

<div class="page-heading">
	<h1>Add Table</h1>
</div>

<div class="form-container">
<?php 
    $branch = new branch();
    $all_branch = $branch->get_branches();
    $branch_table = new branch_table();
    $ID = isset($_GET['id']) ? $_GET['id'] : NULL;
    if (isset($_POST['add_branch_table'])) {
        // Update old record
        if (isset($ID)) {
            $results = $branch_table->update_branch_table($_POST, $ID);
        } else {
            // Insert new
            $results = $branch_table->insert_branch_table($_POST);
        }
        if ($results) {
            echo '<div class="alert alert-success" role="alert">';
            echo isset($_GET['id']) ? 'Updated ' : 'Added ';
            echo 'Tables Sucessfully </div>';
        } else {
            echo '<div class="alert alert-danger" role="alert"> Error </div>';
Пример #2
0
<?php 
if (isset($_SESSION['company_id'])) {
    ?>
	<ul class="breadcrumb">
	    <li><a href="#">Home</a></li>
	    <li><a class="active" href="#">Branches Tables</a></li>
	</ul>

<div class="page-heading">
	<h1>View Tables</h1>
</div>

	<div class="table-responsive custom-table">
		<?php 
    $branch = new branch();
    $branch_table = new branch_table();
    $results = $branch_table->get_branch_table();
    ?>
		<table id="myTable">  
	        <thead>  
	          <tr>  
	            <th>Name</th> 
	            <th>Branch</th>  
	            <th>Status</th> 
	            <th></th>  
	          </tr>  
	        </thead>  
	        <tbody>  

	        <?php 
    foreach ($results as $res) {