<link href="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/ui.theme.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/autocomplete.css" rel="stylesheet">
    <script src="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.min.js"></script>
	

<script>
	function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

    // document.body.innerHTML = printContents.fontsize(12);
     window.print();

	 if( window.print()) {
         window.location.href = "../user/allinvoices";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../user/allinvoices";

		    // document.body.innerHTML = originalContents;

	}
}
	</script>


         <script type="text/javascript">
  		$(this).ready( function() {  
            $("#mysupplier").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                        url: "<?php echo base_url(); ?>Systemusers/customerSaleslookup",  
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });
		
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
			
		 $(document).on("click", "#convertsales", function()
        {
          var salesid = $(this).data('id');
		  $("#salesid").val(salesid); 
		  
		            var salesinvoice = $(this).data('invoice');
		  $("#salesinvoice").val(salesinvoice); 
		   
        });
		
			 $(document).on("click", "#approvebtn", function()
        {
          var aprrovalid = $(this).data('id');
		  $("#aprrovalid").val(aprrovalid); 
		   var aprrovalinvoice = $(this).data('invoice');
		  $("#aprrovalinvoice").val(aprrovalinvoice); 
		  
		  
		   
        });
		
    </script> 
 <style type="text/css">
  
  

    #myprint { display: none; }
#print{  	


    background-repeat: no-repeat;
	font-size;20px;
  
    width:100%; 


}

#sale{  	


    background-repeat: no-repeat;
  
    width:100px; height:50px;


}
    @media print
    {
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:16; width:100%; }
		    	#myprint { display: block; font-size:16; width:100%; }

    }
    </style>
 
 
 <div class="row">
  
   	

   	<div class="col-md-12">
			<?PHP
 echo $this->session->flashdata('deletemsg'); 
	 $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'];	
	    $addquation=$this->usermodel->populatuserpermissionsdataarray('quotation','add',$userid);
		    $approverequest=$this->usermodel->populatuserpermissionsdataarray('purchases','approve',$userid);


	 $updateaction=$this->usermodel->populatuserpermissionsdataarray('purchases','update',$userid);
  $updatebuyingpriceaction=$this->usermodel->populatuserpermissionsdataarray('purchases','updatebuyingprice',$userid);
  $deleteaction=$this->usermodel->populatuserpermissionsdataarray('purchases','delete',$userid);
  $updatesellingpriceaction=$this->usermodel->populatuserpermissionsdataarray('purchases','updatesellingprice',$userid);
    $updateclosedinvoiceaction=$this->usermodel->populatuserpermissionsdataarray('purchases','updateclosedinvoice',$userid);

	   	      $viewdirectpurchases=$this->usermodel->populatuserpermissionsdataarray('purchases','viewdirectpurchases',$userid);
	   	      $viewserials=$this->usermodel->populatuserpermissionsdataarray('purchases','viewserials',$userid);

	   $viewquotation=$this->usermodel->populatuserpermissionsdataarray('purchases','viewquotation',$userid);
  $viewpurchase=$this->usermodel->populatuserpermissionsdataarray('purchases','viewpurchase',$userid);
   $salesorder=$this->usermodel->populatuserpermissionsdataarray('purchases','salesorder',$userid);

  $budget=$this->usermodel->populatuserpermissionsdataarray('purchases','budget',$userid);
    $addpeople=$this->usermodel->populatuserpermissionsdataarray('members','add',$userid);

     $viewallquoation=$this->usermodel->populatuserpermissionsdataarray('quotation','viewall',$userid);

$viewdebtors=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','viewdebtors',$userid);
  $viewcreditors=$this->usermodel->populatuserpermissionsdataarray('incomeexpenses','viewcreditors',$userid);
function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}
				echo $this->session->flashdata('msg'); 
								?>	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading" id="non-printable">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
				 <span class="pull-right"> View Quotation</span>
				<?php 
						if($addquation == true){

			?>	

	  <a data-toggle='modal' data-target='#addModal' class="btn btn-info">Create Quotation </a>
												  	  	  <a data-toggle='modal' data-target='#addRequisitionModal' class="btn btn-success">Request Items </a>

			<?php 
			}
			?>				 

					   <a data-toggle='modal' data-target='#addsupplierModal' class="btn btn-default">Create New Customer </a>

				 				 	  <a data-toggle='modal' data-target='#purchaseModal' class="btn btn-info">View  Quotation History </a>
 <div class="pull-right"  >
<form name="print" method="post" action="">
 <input type="submit" id="print"  accesskey="p" class="btn btn-default"  name="print"onclick="printDiv('sortable_table')" value="Print now!" />

 </form></div>

 <div class="collapse navbar-collapse" id="app-navbar-collapse" id="non-printable">
                <!-- Left Side Of Navbar -->
				 <ul class="nav navbar-nav">
				 <?php

 if( $viewserials==true){
 ?>
				   <li><a href="<?php echo base_url(); ?>user/viewserialnumbers">View Serials </a></li>

 
<?php	
}
  ?>
  
   <?php

 if( $viewdirectpurchases==true){
 ?>
                    <li><a href="<?php echo base_url(); ?>user/viewpurchases">View Purchase</a></li>

 
<?php	
}
  ?>
 <?php

 if( $viewquotation==true){
 ?>
                    <li><a href="<?php echo base_url(); ?>user/allquatation">View Quotation</a></li>

 
<?php	
}
  ?>
	  <?php

 if( $salesorder==true){
 ?>
 	  	  				 	  	                    <li> <a href="<?php echo base_url(); ?>user/salesorder"> Sales order</a>	</li>


 
<?php	
}
  ?>
  
  
  
   <?php

 if( $viewpurchase==true){
 ?>
 	  	  				 	  	  			                   <li> <a href="<?php echo base_url(); ?>user/allpurchaseorder">Purchases order</a>	</li>


 
<?php	
}
  ?>
  
  
  
    
   <?php

 if( $budget==true){
 ?>
 	  	  				 	  	  			                   <li> <a href="<?php echo base_url(); ?>user/viewbudget"> Budget</a>	</li>

 
<?php	
}
  ?>
  
  
  
	
	  <?php

 if( $addpeople==true){
 ?>
                         <a data-toggle='modal' data-target='#addsupplierModal' class="btn btn-default">Add Campany </a>

 
<?php	
}
  ?>
	  		


  <?php

 if( $viewdebtors==true){
 ?>
 	  	  				 <a href="<?php echo base_url();?>user/allcreditors" class="btn btn-default"> All Debtors</a>

 
<?php	
}
  ?>
	  <?php

 if( $viewcreditors==true){
 ?>
 						 	  	  				 <a href="<?php echo base_url();?>user/viewallcreditors" class="btn btn-default"> All Creditors</a>

 
<?php	
}
  ?>			

				  
				 
                </ul>
					
                <!-- Right Side Of Navbar -->
            
            </div>

            	</div>
            </div>
			<div class="panel-body">

			
	<div class="widget-content nopadding table_holder table-responsive" >				
	
					<div class="row">
						<div class="col-md-12">
									<div class="col-md-12" id="non-printable">
        <?php 
		
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchallquotation", $attr);?>
            <div class="form-group">
			
                <div class="col-md-9">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="Search for Quotation By Name, company , description,Phone Number, Date sent.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                </div>
                <div class="col-md-3">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-success" value="Search" />
                    <a href="<?php echo base_url(). "user/allquatation"; ?>" class="btn btn-primary">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>

        </div>
							<div class="panel-body">
	
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
  <th>   </th>
    <th> Q.No </th>

  	

			<th>TT Amount </th>
			
			<th> Name  </th>
			<th> Datails </th>
			
				
						<th> TO </th>
	<th> Quotation Date </th>
			<th> Cancel Date </th>
				<th> Created Date </th>

					<th> Created by </th>
				<th> status </th>
																				<th> Approver</th>

					<th  id="non-printable">More</th>

		


                 </tr>
             </thead>
<?php
 if(!is_array($viewpurchases)) {
				    echo '<div class="alert alert-danger text-center">There was no purchase found in the system</div>';

			 }else{
 if(!is_array($viewpurchases)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='1'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  $totalamount=0;
  	foreach ($viewpurchases as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;
$invoice_number=$c->invoice;
$totalamount=$totalamount+$c->amount ; 
?>

              
  <td><?php 
  if($invoice_number==""){
	  echo $c->invoice_number ; 
	  
  }else{
	  
	  ?>
	  	  	  	 <a  id="non-printable" class="btn btn-default"  href="<?php echo base_url();?>user/viewnewquotation?randomitemidentifier=<?php   {echo  $invoice_number;}  ?>">View  </a>

  

	  
	 <?php  
  }
  ?>
  

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


  <td><?php echo formatMoney( $c->amount,true) ; ?></td>
  
  
  
  
	 <td>
	 

			 
	 <a   id="non-printable"  href="<?php echo base_url();?>user/editmember?randomitemidentifier=<?php   {echo  $c->supplier ;}  ?>">


	
	 <?php  $userids= htmlspecialchars($c->supplier);

$myuser=$this->usermodel->getpeople($userids);
    $myname=$myuser[0]['company'];
     $firstname=$myuser[0]['firstname'];
   if($myname!=""){
	   echo $myname;
	   
   }else{
	   
	   
	   if($firstname!=""){
		   echo $firstname; 
	   }else{
		   echo $c->supplier ;
	   }
	   
   }

  ?>
  </a>
  
  
  </td>
	  
	  
	  <td><?php echo $c->description; ?></td>
	   <td><?php echo $c->shippingto ; ?></td>
	     <td><?php echo $c->orderdate ; ?></td>
    
    <td><?php echo $c->canceldate ; ?></td>

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

	 

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

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

	
	 <?php  $controller= $c->approvedby ;

$controller=$this->usermodel->getpeople($controller);
    
     $firstname=$controller[0]['firstname'];
 
	   echo $firstname; 
	   
   

  ?>
</td>
 <td  id="non-printable"> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-info 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 -->
                                      
								
                                        
                               
							   
							   	  <li> 
							   <a  id="more" class="btn btn-info" href="<?php echo base_url();?>user/printquotation?invoice=<?php   if(isset($purchaseorder[0]['invoice'])) {echo $purchaseorder[0]['invoice']; } ?>">  Print Quotation    </a>
</li>
    <li class="divider"></li>
	  <li> 
<a  id="more" class="btn btn-info" href="<?php echo base_url();?>user/printprofomainvoice?invoice=<?php   if(isset($purchaseorder[0]['invoice'])) {echo $purchaseorder[0]['invoice']; } ?>">  Print proforma Invoice    </a>

		</li>					   
				                                        <li class="divider"></li>		   
			     <li>  <li>
										 <a class="btn btn-info managebtn" id="convertsales"		data-invoice='<?php echo  $c->invoice;?>'    data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#convertsalesModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Convert To Sales
                                                </a>
                                                        </li>
								<?php
										if($usertype=="admin"){
											
											?>
											 <li class="divider"></li>
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#deleteModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
										<?php
										}
										
										if($approverequest==TRUE){
											
											?>
																						 <li class="divider"></li>

                                     	  <li> 

	 <a class="btn btn-default approvebtn" id="approvebtn" data-invoice='<?php echo  $c->invoice;?>'   data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#approveModal'> 	 

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

	<?php endforeach;} ?>

              <?php }?>
 					
        </table>
		<div class="col-md-12 text-center">    <?php echo $links; ?>
					   		<span style="color:red; font-size:20px"><?php  echo $total_rows. "   Quotation (s) in the system. " ;?>    </span>

        
        </div>
	</div>

	
	
	
	
	
	
	
	<div id="approveModal" 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">Approval</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to process this application? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/approvemyrequest' , 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="quotation">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/allquatation">

 
 
 
   
   	<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=""  selected="selected">---Select Status---</option>
	<option value="Approved"  >Final Approved</option>
		<option value="Temporary Approved"  >Temporary Approved</option>

		<option value="Rejected"  >Rejected</option>
				<option value="Progress"  >Progress</option>
								<option value="Active"  >Active</option>

								<option value="Returned"  >Returned</option>

	</select>		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Comments</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter any comments"></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		
 
 
 <div class="form-group">
    <label for="inputapprovedby" class="col-sm-2 control-label">Approved  By?</label>
    <div class="col-sm-10">
	<select class="form-control" name="approvedby" required>
	
	<option value=""  >---Approved By?--</option>

		
	<?php 
				
				
	
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
   // echo 'No user available.';
}
	
?>

	<?php 
				
				
		if($usertype=="admin"){
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
    echo 'No user available.';
}
		}
?>

</select>





		

	</div>
  </div>
  

 
 
 
 
 <input type="hidden" id="aprrovalid"name="aprrovalid" class="aprrovalid" placeholder="aprrovalid" value=""><br>
  <input type="hidden" id="aprrovalinvoice"name="aprrovalinvoice" class="aprrovalinvoice" placeholder="aprrovalinvoice" value=""><br>

 <button type="button" class="btn btn-warning" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_updatepoapproval" value="approval" class="btn btn-default"> YES  </button>

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

  </div>

  </div>
	
	
	
	
	
	
	
	
	
	
				<div id="addsupplierModal" 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">Add new  Campany/Customer</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addmember' , 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="status" value="1"id="status" class="form-control" required placeholder="Enter status">

<input type="hidden" name="view" value="user/allquatation"id="view" class="form-control" required placeholder="Enter status">


	
		 
				
					<div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">	Category	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="category" >
	<option value=""  >---Select category---</option>
	<option value="member"  >Customer</option>
			<option value="prospects" selected="selected"  >Prospects</option>

		<option value="supplier" >Supplier</option>
				<option value="user"  >Employee</option>
								<option value="accomodation" >Accomodation</option>

				<option value="reseller"  >Reseller/Agents</option>

	</select>		 
				
		<span class="text-danger"> <?php echo form_error('category'); ?>
		
		</span>
	</div>
  </div>
						
						
					<div class="form-group">
    <label for="inputcompany" class="col-sm-2 control-label">	Company Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="company" required value="<?php echo set_value('company'); ?>" class="form-control"  placeholder="Enter company name if any">
		 
				
		<span class="text-danger"> <?php echo form_error('company'); ?>
		
		</span>
	</div>
  </div>	
						
						
						
						
						
						
						
	<div class="form-group">
    <label for="inputfirstname" class="col-sm-2 control-label"> Contact	Names<span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" name="firstname" value="<?php echo set_value('firstname'); ?>" class="form-control" required placeholder="Enter first and last name">
		 
				
		<span class="text-danger"> <?php echo form_error('firstname'); ?>
		
		</span>
	</div>
  </div>

  
  	<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">	Phone <span style="color:red;">*</span></label>
    <div class="col-sm-10">
	
		  		<input type="text" name="phone" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="Enter phone e.g 254712345678">
		 
				
		<span class="text-danger"> e.g 254712345678 <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
  
   	<div class="form-group">
    <label for="inputphoneaddress_1" class="col-sm-2 control-label">Phone 2	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="address_1" value="<?php echo set_value('address_1'); ?>" class="form-control"  placeholder="Enter other line e.g 254712345678">
		 
				
		<span class="text-danger">Other Number e.g 254712345678 <?php echo form_error('address_1'); ?>
		
		</span>
	</div>
  </div>
  
   	<div class="form-group">
    <label for="inputphonegender" class="col-sm-2 control-label">Contact	Gender	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="gender" >
	
	<option value=""  >---Select Gender---</option>
	<option value="female"  >female</option>
		<option value="male"  >male</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('gender'); ?>
		
		</span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputcountry" class="col-sm-2 control-label">Country?</label>
    <div class="col-sm-10">
	<select class="form-control" name="country" >
	


	
	<?php 
					 
			$mycountry = $this->nationmodel->populatenation();
	


if(is_array($mycountry)) {

   foreach($mycountry as $mycountryrow){

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



	<?php

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

	</div>
  </div>
  
  
  
  
    	<div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">	Email </label>
    <div class="col-sm-10">
	
		  		<input type="email" name="email" value="<?php echo set_value('email'); ?>" class="form-control"  placeholder="Enter Your email">
		 
				
		<span class="text-danger"> <?php echo form_error('email'); ?>
		
		</span>
	</div>
  </div>
  
  	
  	
  	<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">	ID Number	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter idno if any ">
		 
				
		<span class="text-danger"> <?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
  
  
  
     
   	<div class="form-group">
    <label for="inputidnumber" class="col-sm-2 control-label">	PIN  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idnumber" value="<?php echo set_value('idnumber'); ?>" class="form-control"  placeholder="Enter Campany Pin">
		 
				
		<span class="text-danger"> <?php echo form_error('idnumber'); ?>
		
		</span>
	</div>
  </div>
  
  
     
  
  
  
  
    
  	<div class="form-group">
    <label for="inputcity" class="col-sm-2 control-label">	City 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="city" value="<?php echo set_value('city'); ?>" class="form-control"  placeholder="Enter City or town">
		 
				
		<span class="text-danger"> <?php echo form_error('city'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  	<div class="form-group">
    <label for="inputzip" class="col-sm-2 control-label">	Zip Code 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="zip" value="<?php echo set_value('zip'); ?>" class="form-control"  placeholder="Enter Zip Code">
		 
				
		<span class="text-danger"> <?php echo form_error('zip'); ?>
		
		</span>
	</div>
  </div>
  
  
  
 
  
  	
 
  
    	<div class="form-group">
    <label for="inputwebsite" class="col-sm-2 control-label">		Website/Link 	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="website" value="<?php echo set_value('website'); ?>" class="form-control"  placeholder="Enter website if any">
		 
				
		<span class="text-danger"> <?php echo form_error('website'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputentrydate" class="col-sm-2 control-label">	Entry date  	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="entrydate" value="<?php echo set_value('entrydate'); ?>" class="form-control"  placeholder="Enter Entry date">
		 
				
		<span class="text-danger"> <?php echo form_error('entrydate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="comments" value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter comments"></textarea>
			
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
		

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="member" name="btn_addmember" class="btn btn-default"> Add Campany   </button>

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

    

				</div>

		</div>
	    </div>
    </div>						
			
	
	
			<div id="purchaseModal" 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">Quotation  Report</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
					  $mydate=date("Y-m-d H:i:s");

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/searchquotaion' , 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="inputpreparedby" class="col-sm-3 control-label">Brepared by?</label>
    <div class="col-sm-9">
	<select class="form-control" name="preparedby" style ="width: 100%"  required>
	
	<option value=""  >---Select staff---</option>

						<?php
		
		if($viewallquoation==true){
			///$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'status',1);
						$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');

			?>
					<option value="all"  >---All staffs---</option>
			
<?php


 }else{
	 						$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'id',$userid);

			///$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$myuserid,'status',1);

 
  
 }
  ?>

	
	
	
	<?php 
				
				
	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

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

	</div>
  </div>
	
	
	
	
	
	
  <div class="form-group">
    <label for="inputfromdate" class="col-sm-3 control-label">From Date </label>
    <div class="col-sm-9">
	
		  		<input type="text" name="fromdate" value="<?php echo set_value('fromdate',$mydate); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputtodate" class="col-sm-3 control-label">	To Date </label>
    <div class="col-sm-9">
	
		  		<input type="text" name="todate" value="<?php echo set_value('todate',$mydate); ?>" class="form-control" required placeholder="Enter End date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="event" name="btn_addevent" class="btn btn-info"> View Quotation  </button>

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

    

				</div>

		</div>
	    </div>
    </div>	
	
	
	
	
	
	
	
	
	
	
	
	<div id="deleteModal" 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="quotation">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/allquatation">
 <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="convertsalesModal" 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">Convert Quotation </h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to convert this quotation to? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/convertsales' , 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="quotation">



     	<div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">Convert to?	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="type" required  id="type" >
	

	<option value=""  >---Which sales type do you need?---</option>

				<option  selected="selected" value="SalesOrder"  >Sales Order/Cash/Invoice</option>

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









 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/allquatation">
 <input type="hidden" id="salesid"name="salesid" class="salesid" placeholder="salesid" value=""><br>
  <input type="hidden" id="salesinvoice"name="salesinvoice" class="salesinvoice" placeholder="salesinvoice" value=""><br>

 <button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
 		  	         <button type="submit" name="btn_convertquotation" value="quotation" class="btn btn-danger"> Covert Now  </button>

	<?php echo form_close();?>
      </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">Create new quotation</h4>
      </div>
      <div class="modal-body">
                               <a data-toggle='modal' data-target='#addsupplierModal' class="btn btn-default">Create New Customer </a>

	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addquatation' , 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="view" value="user/allquatation" class="form-control" required placeholder="Enter invoiceno">
<input type="hidden" name="myview" value="user/viewnewquotation?randomitemidentifier=" class="form-control" required placeholder="Enter invoiceno">

								<input type="hidden" name="action" value="insert" class="form-control" required placeholder="Enter invoiceno">
								<input type="hidden" name="orderedby" value="" class="form-control" required placeholder="Enter invoiceno">

	<div class="form-group">
    <label for="inputsupplier" class="col-sm-3 control-label">	Bussines /Customer Name: </label>
    <div class="col-sm-9">
	
		  		<input type="text" id="mysupplier" name="supplier" value="<?php echo set_value('supplier'); ?>" class="form-control"  placeholder="Enter Bussines / Customer Name ">
		 
				
		<span class="text-danger"> <?php echo form_error('supplier'); ?>
		
		</span>
	</div>
  </div>

  	
  			<div class="form-group" style="display:none">
    <label for="inputordernumber" class="col-sm-3 control-label">Quotation  No: </label>
    <div class="col-sm-9">
	
		  		<input type="text" readonly name="ordernumber" value="<?php echo set_value('ordernumber'); ?>" class="form-control"  placeholder="This is automatically generated ">

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

		
			<div class="form-group" style="display:none">
    <label for="inputinvoice" class="col-sm-3 control-label">Ref  No: </label>
    <div class="col-sm-9">
	
		 		<input type="text" readonly name="invoice" value="<?php echo set_value('invoiceno',$finalsalesid); ?>" class="form-control" required placeholder="Enter invoiceno">

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

	
  	
		
				

			
<div class="form-group">
    <label for="inputdescription" class="col-sm-3 control-label">Business Details/Note</label>
    <div class="col-sm-9">

	<textarea name="description" class="form-control" placeholder="Bussines/comments/description"><?php echo set_value('description'); ?></textarea> 
			
	</div>
  </div>
  			
			  <div class="form-group">
    <label for="inputterms" class="col-sm-3 control-label">Terms of quotation </label>
    <div class="col-sm-9">

	<input type="text" name="terms" value="<?php echo set_value('terms',"30 Days"); ?>"id="terms" class="form-control"  placeholder="Enter Terms of payment  ">
			<span class="text-danger"> <?php echo form_error('terms'); ?>
		
		</span>
	</div>
  </div>		
				
	
					  <div class="form-group">
    <label for="inputorderdate" class="col-sm-3 control-label">Quotation Date </label>
    <div class="col-sm-9">

	<input type="text" name="orderdate" value="<?php echo set_value('orderdate',$mydate); ?>"id="orderdate" class="form-control" required placeholder="Enter specific order date  (dd-mm-YYY) ">
			<span class="text-danger"> <?php echo form_error('orderdate'); ?>
		
		</span>
	</div>
  </div>		
			
		
					  <div class="form-group">
    <label for="inputcanceldate" class="col-sm-3 control-label"> Valididty Date </label>
    <div class="col-sm-9">

	<input type="text" name="canceldate" value="<?php echo set_value('canceldate',$mydate); ?>"id="canceldate" class="form-control" required placeholder="Enter cancel order date  (dd-mm-YYY) ">
			<span class="text-danger"> <?php echo form_error('canceldate'); ?>
		
		</span>
	</div>
  </div>		
	
		
		
		
		


			    <div class="form-group" style="display:none">
    <label for="inputamount" class="col-sm-3 control-label">Total Amount   </label>
    <div class="col-sm-9">
		
				<input type="text" name="amount" readonly value="<?php echo set_value('0') ;?>" id="amount" class="form-control"   placeholder="This is automatically calculated  ">

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




				

 <div class="form-group">
    <label for="inputuser" class="col-sm-3 control-label">Prepared By?</label>
    <div class="col-sm-9">
	<select class="form-control" name="preparedby" required>
	
	<option value=""  >---Prepared By?--</option>

		
	<?php 
				
				
	
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
   // echo 'No user available.';
}
	
?>

	<?php 
				
				
		if($usertype=="admin"){
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
    echo 'No user available.';
}
		}
?>

</select>





		

	</div>
  </div>
  


			

 <div class="form-group">
    <label for="inputapprovedby" class="col-sm-3 control-label">Approved  By?</label>
    <div class="col-sm-9">
	<select class="form-control" name="approvedby" required>
	
	<option value=""  >---Approved By?--</option>

		
	<?php 
				
				
	
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
   // echo 'No user available.';
}
	
?>

	<?php 
				
				
		if($usertype=="admin"){
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
    echo 'No user available.';
}
		}
?>

</select>





		

	</div>
  </div>
  




















  
  	<div class="form-group">
    <label for="inputshippingto" class="col-sm-3 control-label">Shipping to?</label>
    <div class="col-sm-9">

	<textarea name="shippingto" class="form-control" placeholder="Enter shipping details if any..It can be the same company detils"><?php echo set_value('shippingto'); ?></textarea> 
			
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputdisplayvat" class="col-sm-3 control-label">	Dispaly Vat?	 </label>
    <div class="col-sm-9">
	
	<select class="form-control" name="displayvat" >
	
	<option value=""  >---	Display vat on Quotation print out?	---</option>
	<option value="no"  selected="selected">No</option>
		<option value="yes"  >Yes</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('displayvat'); ?>
		
		</span>
	</div>
  </div>
 	<div class="form-group" style="display:none">
    <label for="inputweight" class="col-sm-3 control-label">	Add weight?	 </label>
    <div class="col-sm-9">
	
	<select class="form-control" name="weight" >
	
	<option value=""  >---	Add weight?	---</option>
	<option value="No"  selected="selected">No</option>
		<option value="Yes"  >Yes</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('weight'); ?>
		
		</span>
	</div>
  </div>
	
	 <div class="form-group">

    <div class="col-sm-10">
     
	         <button type="submit"  name="btn_quatation"  value="quatation"  class="btn btn-info"> NEXT >> </button>

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

    

				</div>
				</div>
	

		</div>
	    </div>
    </div>			
									
									
					
						
	<div id="addRequisitionModal" 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">Add Request</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addquatation' , 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="view" value="user/allquatation" class="form-control" required placeholder="Enter invoiceno">
<input type="hidden" name="myview" value="user/viewnewquotation?randomitemidentifier=" class="form-control" required placeholder="Enter invoiceno">

								<input type="hidden" name="action" value="insert" class="form-control" required placeholder="Enter invoiceno">

	<div class="form-group">
    <label for="inputorderedby" class="col-sm-3 control-label">	Requested by: </label>
    <div class="col-sm-9">
	
		  		<input type="text" name="orderedby" value="<?php echo set_value('orderedby'); ?>" class="form-control"  placeholder="Enter  Requested  by ">
		 
				
		<span class="text-danger"> <?php echo form_error('orderedby'); ?>
		
		</span>
	</div>
  </div>
<div class="form-group">
    <label for="inputsupplier" class="col-sm-3 control-label">From (Branch name)</label>
    <div class="col-sm-9">
				<input type="text" name="supplier"  value="" id="supplier" class="form-control"   placeholder="From which branch  ">

			
	</div>
  </div>
  	
  			<div class="form-group" style="display:none">
    <label for="inputordernumber" class="col-sm-3 control-label">Requisition  No: </label>
    <div class="col-sm-9">
	
		  		<input type="text" readonly name="ordernumber" value="<?php echo set_value('ordernumber'); ?>" class="form-control"  placeholder="This is automatically generated ">

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

		
			<div class="form-group" style="display:none">
    <label for="inputinvoice" class="col-sm-3 control-label">Ref  No: </label>
    <div class="col-sm-9">
	
		 		<input type="text" readonly name="invoice" value="<?php echo set_value('invoiceno',$finalsalesid); ?>" class="form-control" required placeholder="Enter invoiceno">

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

	
  	
		
				
			  <div class="form-group">
    <label for="inputorderdate" class="col-sm-3 control-label">Requisition Date </label>
    <div class="col-sm-9">

	<input type="text" name="orderdate" value="<?php echo set_value('orderdate',$mydate); ?>"id="orderdate" class="form-control" required placeholder="Enter specific order date  (dd-mm-YYY) ">
			<span class="text-danger"> <?php echo form_error('orderdate'); ?>
		
		</span>
	</div>
  </div>		
			
		
					  <div class="form-group">
    <label for="inputcanceldate" class="col-sm-3 control-label"> Validity / Due Date </label>
    <div class="col-sm-9">

	<input type="text" name="canceldate" value="<?php echo set_value('canceldate',$mydate); ?>"id="canceldate" class="form-control" required placeholder="Enter cancel order date  (dd-mm-YYY) ">
			<span class="text-danger"> <?php echo form_error('canceldate'); ?>
		
		</span>
	</div>
  </div>		
		
		 
	
	
	
	
						
			  <div class="form-group"style="display:none">
    <label for="inputterms" class="col-sm-3 control-label">Terms of quotation </label>
    <div class="col-sm-9">

	<input type="text" name="terms" value="<?php echo set_value('terms',"NA"); ?>"id="terms" class="form-control"  placeholder="Enter Terms of payment  ">
			<span class="text-danger"> <?php echo form_error('terms'); ?>
		
		</span>
	</div>
  </div>		
				
	
		
		
		
		
		


			    <div class="form-group" style="display:none">
    <label for="inputamount" class="col-sm-3 control-label">Total Amount   </label>
    <div class="col-sm-9">
		
				<input type="text" name="amount" readonly value="<?php echo set_value('0') ;?>" id="amount" class="form-control"   placeholder="This is automatically calculated  ">

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




				

 <div class="form-group">
    <label for="inputuser" class="col-sm-3 control-label">Requested By?</label>
    <div class="col-sm-9">
	<select class="form-control" name="preparedby" required>
	
	<option value=""  >---Prepared By?--</option>

		
	<?php 
				
				
	
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
   // echo 'No user available.';
}
	
?>

	<?php 
				
				
		if($usertype=="admin"){
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
    echo 'No user available.';
}
		}
?>

</select>





		

	</div>
  </div>
  














 <div class="form-group">
    <label for="inputapprovedby" class="col-sm-3 control-label">Approved  By?</label>
    <div class="col-sm-9">
	<select class="form-control" name="approvedby" required>
	
	<option value=""  >---Approved By?--</option>

		
	<?php 
				
				
	
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
   // echo 'No user available.';
}
	
?>

	<?php 
				
				
		if($usertype=="admin"){
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

}} else {
    echo 'No user available.';
}
		}
?>

</select>





		

	</div>
  </div>
  









<div class="form-group">
    <label for="inputdescription" class="col-sm-3 control-label">Note/Message</label>
    <div class="col-sm-9">

	<textarea name="description" class="form-control" placeholder="Bussines/comments/description"><?php echo set_value('description'); ?></textarea> 
			
	</div>
  </div>
  

  
  	<div class="form-group">
    <label for="inputshippingto" class="col-sm-3 control-label">To which branch?</label>
    <div class="col-sm-9">
				<input type="text" name="shippingto"  value="" id="shippingto" class="form-control"   placeholder="To which branch  ">

			
	</div>
  </div>
 	<div class="form-group" style="display:none">
    <label for="inputweight" class="col-sm-3 control-label">	Add weight?	 </label>
    <div class="col-sm-9">
	
	<select class="form-control" name="weight" >
	
	<option value=""  >---	Add weight?	---</option>
	<option value="No"  selected="selected">No</option>
		<option value="Yes"  >Yes</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('weight'); ?>
		
		</span>
	</div>
  </div>
	
	 <div class="form-group">

    <div class="col-sm-10">
     
	         <button type="submit"  name="btn_quatation"  value="quatation"  class="btn btn-info"> NEXT >> </button>

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

    

				</div>
				</div>
	

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

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

 
</div>


















