 <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		   
		   		   <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>
   <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
        </script>

 
         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		
		
		$(document).on("click", "#editbtn", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		   
		     var status = $(this).data('status');
		   $("#status").val(status); 
 
		    var categoryno = $(this).data('categoryno');
		   $("#categoryno").val(categoryno); 
		   
		     var description = $(this).data('description');
		   $("#description").val(description); 
		 
		       var branchid = $(this).data('branchid');
		   $("#branchid").val(branchid); 
		  
		   
        });
		
		
		
		
    </script>   
 
 <div class="row">
  
   	

   	<div class="col-md-12">

  				<a href="<?php echo base_url();?>user/viewconfiguration" class="btn btn-warning">   Back to Configuration</a>	
				<!--
  				<a target="_blank" href="<?php echo base_url();?>pendingorder" class="btn btn-info">   Open Default Printing Window</a>	
-->
								 <a data-toggle='modal' data-target='#addModal' class="btn btn-primary">Open  Printing Window </a>
								 <a data-toggle='modal' data-target='#adddisplayModal' class="btn btn-primary">Open  Display Window </a>


			
	<div class="widget-content nopadding table_holder table-responsive" >				
			
		 <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update Order Printer Window</h4>
      </div>
      <div class="modal-body">
      
	  <?PHP
	
$session_data = $this->session->userdata('logged_in');

 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
 echo $this->session->flashdata('mymsg'); 
                  echo form_open('user/updatedkitchenprinter' , array('class' => 'form-horizontal form-groups-bordered validate',  'id' => 'signup','enctype' => 'multipart/form-data'));

		 if(validation_errors()):?>

<?php endif;?>

				<input type="hidden" name="myid" value="<?php echo set_value('myid',$configuration[0]['id']); ?>"id="myid" class="form-control"  placeholder="Enter myid">


  	<div class="form-group">
    <label for="inputkitchen" class="col-sm-2 control-label"> Activate Kitchen Printer?	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="kitchen" required >
		<option value="<?php echo $configuration[0]['kitchen']; ?>"  select="selected" ><?php echo $configuration[0]['kitchen']; ?></option>

	<option value=""  >---Do you want to Activate or Deactivate Kitchen Printer?</option>
	<option value="yes"  >yes(Multiple)</option>
		<option value="no"  >no</option>
		
	</select>		 
				
		<span class="text-danger">Activate or Deactivate Kitchen Printer<?php echo form_error('kitchen'); ?>
		
		</span>
	</div>
  </div>

  
 
  
  
 
   
			
	  <div class="form-group" style="display:none">
    <label for="inputkitchenid" class="col-sm-4 col-lg-2 col-md-2 col-xs-4 control-label">Kitchen No</label>
    <div class="col-sm-10">
				<input type="text" name="kitchenid" value="<?php echo set_value('kitchenid',$configuration[0]['kitchenid']); ?>"id="oldvat" class="form-control"  placeholder="Enter kitchen No">
    <span class="text-danger">Check from Main Category:				<a href="<?php echo base_url();?>user/viewmaincategory" class="btn btn-info">   :Here</a>	
<?php echo form_error('kitchenid'); ?></span>
   </div>
  </div>
  
   
   
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="printer" name="btn_updatedkitchenprinter" class="btn btn-primary"> Update Kitchen Printer </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>

				
				
				
				
			<center>	<h2>Enable Category Order Printing</h2>	</center>
												 <a data-toggle='modal' data-target='#addprinterModal' class="btn btn-info">Create / Enable Category Printer </a>

						<div class="panel-body">
	 <?PHP
	 echo $this->session->flashdata('deletemsg'); 

	
 echo $this->session->flashdata('msg'); 
									
				?>					
  <table cellpadding="1" cellspacing="1" border="1" class="table table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
     <th>NO</th>
     <th>Category No</th>
	     <th>Description</th>
		 	     <th>Counter</th>
<th>Status</th>		 
		
	<th>More</th>	

                 </tr>
             </thead>
<?php

 if(!is_array($printers)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='6'>";
    
       echo '<div class="alert alert-warning text-center">There printer enable..Create one Printer or more</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($printers as $c): 

		 

             ?>

<tbody>

             <tr>
                
            <?php 
$id=$c->id;


?>

    
  <td><?php echo $c->id ; ?></td>          
   <td><?php 
  		$mycategoryno = $this->usermodel->populateallarray('maincategory','id',$c->categoryno);
echo $c->categoryno."-".$mycategoryno[0]['name'];


		?></td>
    <td><?php echo $c->description ; ?></td>
	    <td><?php 
  		$mybranch = $this->usermodel->populateallarray('branch','id',$c->branchid);
echo $c->branchid."-".$mybranch[0]['name'];

		?></td>
	  <td><?php echo $c->status ; ?></td>
	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										<?php
										if($usertype=="admin"){
											
											?>
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                        
                                     	  <li> 

	 <a class="btn btn-primary editbtn" id="editbtn"    data-branchid='<?php echo  $c->branchid;?>' data-categoryno='<?php echo  $c->categoryno;?>' data-status='<?php echo  $c->status;?>' data-description='<?php echo  $c->description;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Update
                                                </a>
                                                        </li>
                                        	<?php
										}
										?>
										
										    
                                    </ul>
										
                                    </ul>
										
                                </div>
</td>
		 
		 
		 
             </tr>
</tbody>

	<?php endforeach;} ?>

            
        </table>

									
									
									
					</div>
				
				
				
				
					
					
<div id="editProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update Printer</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addnewprinter' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
			  			<input type="hidden" name="action" value="update"  class="form-control"  placeholder="Enter action">




<div class="form-group">
    <label for="inputcategoryno" class="col-sm-2 control-label">Category No</label>
    <div class="col-sm-10">
	<select class="form-control" name="categoryno"  id="categoryno"  required  >

	
			<option value=""  selected="selected"></option>

	<option value=""  >---Select Category---</option>

	
	<?php 
					 

					 $allcategories= $this->usermodel->populateall('maincategory','companyid',$companyid);



if(is_array($allcategories)) {

   foreach($allcategories as $allcategoriesrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $allcategoriesrow->id;   ?>"><?= $allcategoriesrow->id. "-". $allcategoriesrow->name; ?></option>



	<?php

}} else {
    echo 'No category available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('categoryno'); ?>

	</div>
  </div>
  	


<div class="form-group">
    <label for="inputbranchid" class="col-sm-2 control-label">Branch/ Counter</label>
    <div class="col-sm-10">
	<select class="form-control" name="branchid" id="branchid"  required  >

		<option value=""  selected="selected"></option>

	
	<option value=""  >---Select Branch/Counter ---</option>

	
	<?php 
					 

					 $branch= $this->usermodel->populateall('branch','companyid',$companyid);
					//$branch  = $this->usermodel->populatealldatanoarray('branch','id', $branchid,'companyid',$companyid );



if(is_array($branch)) {

   foreach($branch as $branchrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $branchrow->id;   ?>"><?=  $branchrow->id."-".$branchrow->name; ?></option>



	<?php

}} else {
    echo 'No branch available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('branchid'); ?>

	</div>
  </div>









 
 
  	
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  id="description" class="form-control"  placeholder="Enter description"></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		 <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Status?</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" id="status" required>
			<option value="" selected="selected"  ></option>

		<option value="active" >Active</option>
		<option value="inactive"  >Inactive</option>

	

</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="printer" name="btn_postprinter" class="btn btn-primary"> Update  Category Printer  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
					
					
				
				
				
				
				
				
				
					
						<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('logged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="printers">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/kitchenprinter">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>				
				



<div id="adddisplayModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Open Display Window</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('startdisplayingkitchenorder' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>





<div class="form-group">
    <label for="inputcategoryno" class="col-sm-2 control-label">Category No</label>
    <div class="col-sm-10">
	<select class="form-control"  name="categoryno"  required  >

	
	
	<option value="" selected="selected" >---Select Main Category/Department Printer---</option>

		<option value="all" >-All branches-</option>

	<?php 
					 

					 $allcategories= $this->usermodel->populateall('maincategory','companyid',$companyid);



if(is_array($allcategories)) {

   foreach($allcategories as $allcategoriesrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $allcategoriesrow->id;   ?>"><?= $allcategoriesrow->id. "-". $allcategoriesrow->name; ?></option>



	<?php

}} else {
    echo 'No category available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('categoryno'); ?>

	</div>
  </div>










		
<div class="form-group">
    <label for="inputbranch" class="col-sm-2 control-label">Branch/ Counter</label>
    <div class="col-sm-10">
	<select class="form-control" name="branch"  required  id="branch" >

	
	<option value="" selected></option>
	
	<option value="" selected="selected" >---Select Branch/Counter to Open---</option>

	
	<?php 
					 

					 $branch= $this->usermodel->populateall('branch','companyid',$companyid);
					//$branch  = $this->usermodel->populatealldatanoarray('branch','id', $branchid,'companyid',$companyid );



if(is_array($branch)) {

   foreach($branch as $branchrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>



	<?php

}} else {
    echo 'No branch available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('branch'); ?>

	</div>
  </div>
  	





	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="printing" name="postprintingwindow" class="btn btn-primary"> Open the Display Window  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>









<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Open Printing Window</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('startprintkitchenorder' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
				  		
<div class="form-group">
    <label for="inputcategoryno" class="col-sm-2 control-label">Category No</label>
    <div class="col-sm-10">
	<select class="form-control"  name="categoryno"  required  >

	
	
	<option value="" selected="selected" >---Select Main Category Printer---</option>

	
	<?php 
					 

					 $allcategories= $this->usermodel->populateall('maincategory','companyid',$companyid);



if(is_array($allcategories)) {

   foreach($allcategories as $allcategoriesrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $allcategoriesrow->id;   ?>"><?= $allcategoriesrow->id. "-". $allcategoriesrow->name; ?></option>



	<?php

}} else {
    echo 'No category available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('categoryno'); ?>

	</div>
  </div>
  	
<div class="form-group">
    <label for="inputbranch" class="col-sm-2 control-label">Branch/ Counter</label>
    <div class="col-sm-10">
	<select class="form-control" name="branch"  required  id="branch" >

	
	
	<option value="" selected="selected" >---Select Branch/Counter to Open---</option>

	
	<?php 
					 

					 $branch= $this->usermodel->populateall('branch','companyid',$companyid);
					//$branch  = $this->usermodel->populatealldatanoarray('branch','id', $branchid,'companyid',$companyid );



if(is_array($branch)) {

   foreach($branch as $branchrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>



	<?php

}} else {
    echo 'No branch available.';
}
	
?>
	<option value="all" >All counters</option>

</select>
		
						<span class="text-danger"><?php echo form_error('branch'); ?>

	</div>
  </div>
  	





	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="printing" name="postprintingwindow" class="btn btn-primary"> Open the Printing Window  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>




<div id="addprinterModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Create/Enable Category Printer</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addnewprinter' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" name="action" value="insert"  class="form-control"  placeholder="Enter action">
			  			<input type="hidden" name="mycategoryid" value=""class="form-control" required placeholder="Enter mycategoryid">

<div class="form-group">
    <label for="inputcategoryno" class="col-sm-2 control-label">Category No</label>
    <div class="col-sm-10">
	<select class="form-control" name="categoryno"  required  >

	
	
	<option value="" selected="selected" >---Select Category---</option>

	
	<?php 
					 

					 $allcategories= $this->usermodel->populateall('maincategory','companyid',$companyid);



if(is_array($allcategories)) {

   foreach($allcategories as $allcategoriesrow){

   //echo $courserow->coursename;
    ?>
					<option   value="<?=  $allcategoriesrow->id;   ?>"><?= $allcategoriesrow->id. "-". $allcategoriesrow->name; ?></option>



	<?php

}} else {
    echo 'No category available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('categoryno'); ?>

	</div>
  </div>
  	


<div class="form-group">
    <label for="inputbranchid" class="col-sm-2 control-label">Branch/ Counter</label>
    <div class="col-sm-10">
	<select class="form-control" name="branchid"  required  >

	
	
	<option value=""  >---Select Branch/Counter ---</option>

	
	<?php 
					 

					 $branch= $this->usermodel->populateall('branch','companyid',$companyid);
					//$branch  = $this->usermodel->populatealldatanoarray('branch','id', $branchid,'companyid',$companyid );



if(is_array($branch)) {

   foreach($branch as $branchrow){

   //echo $courserow->coursename;
    ?>

					<option   value="<?=  $branchrow->id;   ?>"><?=  $branchrow->id."-".$branchrow->name; ?></option>


	<?php

}} else {
    echo 'No branch available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('branchid'); ?>

	</div>
  </div>
  	
<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description / Name</label>
    <div class="col-sm-10">

				<textarea name="description" required value="<?php echo set_value('description'); ?>"  id="description" class="form-control"  placeholder="Enter description or category printer name"></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>


<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status"  required  >

	
	
	<option value=""  >---Select Status ---</option>
	<option value="active" selected="selected"  >Active</option>
	<option value="inactive"  >Inactive</option>

	
</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>


	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="printer" name="btn_postprinter" class="btn btn-primary"> Create New Printer  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>






