<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php");


 $pageName = basename($_SERVER['PHP_SELF']);

 $m->where("page_name", $pageName);
 $pageNameAccess=$m->get("eduportal_modules_pages_detail");

$m->where("user_id", $_SESSION['user_id']);
$m->where ("branch_id", $_SESSION['branch']);
$m->where("page_id", $pageNameAccess[0]['page_id']);
$access = $m->get("users_privilege_detail");


$pageName=basename($_SERVER['PHP_SELF']);

 $m->where("page_name", $pageName);
 $video = $m->get("eduportal_modules_pages_detail");

 //echo $video[0]['video_url'];



 ?>

<!DOCTYPE html>
<html lang="en">
  <head>
 
    <title>Manage Brand | EduPortal</title>
   <?php include('RootMe/css_links.php');?>
   
  </head>
  
  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
     
            <?php include('RootMe/sidebar.php');?>

              <?php include('RootMe/header.php');?>
     
  <!-- page content -->
    <div class="right_col" role="main">

      <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
              Manage Brand
                  <br><br>
        
      <div class="clearfix"></div>
    <div class="row" style="background-color:white;">
       
<section class="add_sub_agent" id="table_sub_agent">
  <div class="container">
   <div class="box_visa_form">
    <div class="table-responsive" style="min-height:320px;padding:3%;">

 
        <div class="col-md-12 ">    
       
            <div class="col-md-3 ">    
             <h3>Manage Brand</h3>

            </div>
           
       </div>



      <table class="table table-striped table-bordered" style="width: 60%;float: left;">
        <thead>
          <tr class="" style="font-weight: bold;background-color: #1f3163;color:white;">
            <td>Brand Name</td>
            <td> Unit  </td>  
            <td> Brand Code  </td>     
            <td> Created  </td>    
            <td> Action</td>
          </tr>
        </thead>
        <tbody>
 <?php

$m->where("branch_id", $_SESSION['branch']);

$WorkAssignList = $m->get("eduportal_brand_config");



?> 
<?php
if($WorkAssignList[0]>0)
{
foreach($WorkAssignList as $WorkAssignListVal)
{
if(is_array($WorkAssignListVal))
{

 

?>             
          <tr>
            <td><?php echo $WorkAssignListVal['brand_name'];?></td>           
            <td><?php echo $WorkAssignListVal['unit'];?></td>
            <td><?php echo $WorkAssignListVal['brand_code'];?></td>
            <td><?php echo date("d-M-Y", strtotime($WorkAssignListVal['created_date']));?></td>
            <td>

           

            <a  href="brand.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&id=<?php echo $WorkAssignListVal['brand_id'];?>" style="cursor:pointer;padding: 0px 5px;"  class="btn btn-success"><i class="fa fa-pencil"></i></a>

            <a href="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php?id=<?php echo $WorkAssignListVal['brand_id'];?>&action=DeleteBrand" style="padding: 0px 5px; font-size:14px;" onClick="return confirm('Are you sure you want to delete this record');"  class="btn btn-danger"><i class="fa fa-remove"></i> </a>
            
         

        
            </td>

          </tr>
             
             
       <?php 
$i++;
} } } else { ?>

<tr><td colspan="9" ><p style="margin-top:15px; margin-bottom:10px;"><a href="" class="label label-danger" style="padding: 8px;font-size:15px;">There is no any Brand added by you</a></p>
</td></tr>
<?php } ?>   
         
        </tbody>
      </table>
      <div class="addclasswidth">
        <style type="text/css">
  .inputfield{
    width: 100%;
    height:34px;
  }
</style>

<form class="form-style-7" action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post" enctype="multipart/form-data">


   <?php 
if(isset($_REQUEST['id'])) { 


$m->where("brand_id", $_REQUEST['id']);
$brandData = $m->get("eduportal_brand_config");


  ?>

    <input type="hidden" name="action" value="EditBrand">
    <input type="hidden" name="bid" value="<?php echo $_REQUEST['id'];?>">

<?php } else { ?>

<input type="hidden" name="action" value="AddBrand">
<?php } ?>




      <ul style="list-style-type:none;">
       <div class="col-md-10"> <h3 class="heding_name">Add Brand </h3></div>

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

        <li>
          <label for=""> Brand Name </label>
          <input type="text" name="brand_name" class="inputfield" value="<?php echo $brandData[0]['brand_name'];?>"   autocomplete="off" required maxlength="100">
        </li>
  

          
        <li>
          <label for=""> Unit </label>
          <input type="text" name="unit" class="inputfield"  value="<?php echo $brandData[0]['unit'];?>"  required maxlength="100">
        </li>

        <li>
          <label for=""> Brand Code </label>
          <input type="text" name="brand_code" class="inputfield"  value="<?php echo $brandData[0]['brand_code'];?>"  required maxlength="100">
        </li>
    
        <div class="clearfix"></div>
        <li class=" pull-left" style="margin-top:30px;">
        
          <input type="submit" value=" Submit " class="btn btn-primary" >
        </li>
      </ul>
    </form>

      </div>

    </div>
      <div class="clearfix"></div>
     </div>
  </div>
  <div class="clearfix"></div>
</section>
<section class="sub_agent_form" id="sub_user_form" style="display:none;">
  <div class="container">
   <div class="box_visa_form">
    

    


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

    <?php include('RootMe/js_linksscript.php');?>
  
  </body>
</html>
