Sign in to follow this  
Landi20

problem with angularjs

Recommended Posts

i create a model and i want show only the data is of one person but i only can show all data is table

app.js

var app = angular.module('myApp', ['ui.bootstrap']);

app.filter('startFrom', function() {
	return function(input,start) {
		if (input) {
			start = +start;
			//parse to int
			return input.slice(start);
		}
		return [];
	}
});
app.controller('customersCrtl', function($scope, $http, $timeout) {

	$scope.get_product = function() {
		$http.get('app/app.php?action=get_product').success(function(data) {
			//$scope.product_detail = data;
			$scope.list = data;
			$scope.currentPage = 1;
			//current page
			$scope.entryLimit = 5;
			//max no of items to display in a page
			$scope.filteredItems = $scope.list.length;
			//Initially for no filter
			$scope.totalItems = $scope.list.length;

		});
	}
	/*$http.get('app/projectos.php').success(function(data){
	 $scope.list = data;
	 $scope.currentPage = 1; //current page
	 $scope.entryLimit = 5; //max no of items to display in a page
	 $scope.filteredItems = $scope.list.length; //Initially for no filter
	 $scope.totalItems = $scope.list.length;

	 });
	 */
	$scope.setPage = function(pageNo) {
		$scope.currentPage = pageNo;
	};
	$scope.filter = function() {
		$timeout(function() {
			$scope.filteredItems = $scope.filtered.length;
		}, 10);
	};
	$scope.sort_by = function(predicate) {
		$scope.predicate = predicate;
		$scope.reverse = !$scope.reverse;
	};

	$scope.prod_espiar = function(index) {
		$scope.update_prod = true;
		$scope.add_prod = false;
		$http.post('app/app.php?action=edit_product', {
			'ola' : index
		}).success(function(data, status, headers, config) {
			//alert(data[0]["prod_name"]);

			$scope.contintente = data[0]["continente"];
			$scope.nome = data[0]["Nome"];
			$scope.username = data[0]["username"];
			//  $scope.Alianca      =   data[0]["Alianca"];

		}).error(function(data, status, headers, config) {

		});
	}
	$scope.prod_escreve = function(index) {
		$scope.update_prod = true;
		$scope.add_prod = false;
		$http.post('app/app.php?action=edit_product', {
			'ola' : index
		}).success(function(data, status, headers, config) {
			//alert(data[0]["prod_name"]);

			$scope.contintente = data[0]["continente"];
			$scope.nome = data[0]["Nome"];
			$scope.username = data[0]["username"];
			//  $scope.Alianca      =   data[0]["Alianca"];

		}).error(function(data, status, headers, config) {

		});
	}
	$scope.prod_amizade = function(index) {
		$scope.update_prod = true;
		$scope.add_prod = false;
		$http.post('app/app.php?action=edit_product', {
			'ola' : index
		}).success(function(data, status, headers, config) {
			//alert(data[0]["prod_name"]);

			$scope.contintente = data[0]["continente"];
			$scope.nome = data[0]["Nome"];
			$scope.username = data[0]["username"];
			//  $scope.Alianca      =   data[0]["Alianca"];

		}).error(function(data, status, headers, config) {

		});
	}
	$scope.prod_Ataque = function(index) {
		$scope.update_prod = true;
		$scope.add_prod = false;
		$http.post('app/app.php?action=edit_product', {
			'ola' : index
		}).success(function(data, status, headers, config) {
			//alert(data[0]["prod_name"]);

			$scope.contintente = data[0]["continente"];
			$scope.nome = data[0]["Nome"];
			$scope.username = data[0]["username"];
			//  $scope.Alianca      =   data[0]["Alianca"];

		}).error(function(data, status, headers, config) {

		});
	}
});

 

index.php

      <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#<?php echo $d?>" ><?php echo $m['nome']  ?></button>

<div id="<?php echo $d?>"  class="modal fade" role="dialog" >
 

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close"  data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
      	 <div class="row">
    <div class="col-sm-6">
     <p> LogoTipo</p>
      	<p><?php echo "Nif:", $m['nif'], " ";
		echo "CAE:", $m['CAE'];
 ?>
        	</p>
        <p><?php echo "Nome da Empresa:", $m['nome']; ?>
        	</p>
        	 <p><?php echo "Morada:", $m['morada']; ?>
        	</p>
        	 
        	<p><?php echo "Localidade:", $m['Localidade']; ?>
        	</p>
        	<p><?php echo "CodigoPostal:", $m['codigopostal']; ?>
        	</p>
        <p><?php echo "Telefone:", $m['telefone'], " ";
				echo "Fax:", $m['fax'], " ";
				echo "Telemovel:", $m['telemovel'];
 ?>
        	</p>
        	<p><?php echo "Webmail:", $m['email']; ?></p>
       <?php foreach ($servicos->getcategorias($d)as $n): ?>
         <p><?php echo "Categorias:", $n['nome']; ?></p>
     <?php endforeach ?>
    </div>
    <div class="col-sm-6">
    	
     <?php foreach ($servicos->getactividades($d)as $g): ?>
         <p><?php echo "Actividades:", $g['nome']; ?></p>
     <?php endforeach ?>
     
    </div>
 <div ng-controller="customersCrtl">
     
     
<br/>
<div class="row">
	
    <div class="col-md-12" ng-show="filteredItems > 0">
        <table class="table table-striped table-bordered">
        
        <thead  >
        	<th style="visibility:collapse">ID&nbsp;</th>
         <th>Nome&nbsp;</th>
        <th>Descricao&nbsp;</th>
        <th>Quantidade&nbsp;</th>
       <th>Preco Sem Iva&nbsp;</th>
       <th>Descontos&nbsp;</th>
        <th>IVA&nbsp;</th>
         <th>Valor do Desconto&nbsp;</th>
 <th>Valor do IVA&nbsp;</th>         
   <th>Preço TOTAL&nbsp;</th>       
    <th>Ver</th>
        </thead>
        <tbody ng-init="get_product()">
           
            <tr ng-repeat="data in filtered  = (list | filter:search | orderBy : predicate :reverse) |startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit">
             
           <!--tr-->
           <td style="visibility:collapse">{{data.id}}</td>
      			<td>{{data.nome}}</td>
                <td>{{data.descricao}}</td>
                <td>{{data.quantidade}}</td>
                <td>{{data.precosiva}}</td>
                  <td>{{data.descontos}}</td>
                    <td>{{data.iva}}</td>
                     <td>{{data.valordesc}}</td>
                    <td>{{data.valoriva}}</td>
                    <td>{{data.precototal}}</td>
                   
               <td> <button class="btn" ng-click="prod_espiar(data.id)">
      <span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;Selecionar
      </button>
      </td>
            
            </tr>
        </tbody>
        </table>
 
    </div>
    <div class="col-md-12" ng-show="filteredItems == 0">
        <div class="col-md-12">
            <h4>Nenhum projecto Adecionado</h4>
        </div>
    </div>
 
  
    
</div> 
  </div>
  </div>
     
      
      </div>	
      <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Sair</button>
      

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

 

app.php

<?php

//Incluir definicoes de acesso a BD
require_once ('../configurations/Database.php');
//Incluir definicoes de acesso a BD

// algumas funcoes

 switch($_GET['action'])  {
  //  case 'add_product' :
    //        add_product();
      //      break;

    case 'get_product' :
            get_product();
            break;

    //case 'edit_product' :
      //      edit_product();
        //   break;

    ///case 'delete_product' :              
       //     delete_product();
         //   break;

   // case 'update_product' :
     //       update_product();
       //     break;
}
function get_product() {
	    
$link = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if (!$link) {
	die('Falha de ligacao a BD: ' . mysql_error());
}
/*$qry="select distinct c.nome,c.descricao,c.texto,c.categoria from  projecto c order by c.idprojecto";
$result = $link -> query($qry);
 
$arr = array();
if($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        $arr[] = $row;
    }
}else die("ERRO");
# JSON-encode the response
$json_response = json_encode($arr);
 
// # Return the response
echo $json_response;
*/

//$qry="select distinct c.nome,c.descricao,c.texto,c.categoria from  projecto c order by c.idprojecto";
  //$qry ="SELECT nome FROM servicos";
 // where id_empresa='" .$index. "'
 $qry ="SELECT id,nome,descricao,quantidade,precosiva,descontos,iva,valordesc,valoriva,precototal FROM servicos ";
 //$qry ="SELECT * FROM users";
   $result = $link -> query($qry);
    $data = array();
	 if ($result) {
     while($rows = $result->fetch_assoc()) 
    {
        $data[] = array(
        		"id" => $rows['id'],
                  "nome" => $rows['nome'],
                  "descricao" => $rows['descricao'],
				  "quantidade" => $rows['quantidade'],
                  "precosiva" => $rows['precosiva'],
                  "descontos" => $rows['descontos'],
                  "iva" => $rows['iva'],
                  "valordesc" => $rows['valordesc'],
                  "valoriva" => $rows['valoriva'],
                  "precototal" => $rows['precototal']);
    }
  print_r(json_encode($data));
    return json_encode($data);  


}
else 
die("ERRO". mysqli_error());
}
/*
function edit_product() {

    $data = json_decode(file_get_contents("php://input"));     
    $index = $data->ola; 
		$link = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if (!$link) {
	die('Falha de ligacao a BD: ' . mysql_error());
}
   $qry = "SELECT * FROM projecto WHERE idprojecto='" .$index. "'";
   $result = $link ->query($qry);
    $data = array();
    if ($result) {
     while($rows = $result->fetch_assoc()) 
    {
        $data[] = array(
                    "idprojecto"     => $rows['idprojecto'],
                    "nome"     => $rows['nome'],
                   "descricao"     => $rows['descricao']
				    // "categoria" => $rows['categoria']
              //      "texto"    => $rows['texto'],
                  
                    );
    }
    print_r(json_encode($data));
    return json_encode($data); 
	}else die("ERRO");

}
*/




?>

 

Share this post


Link to post
Share on other sites

Then you will need to implement that functionality in your API. This is not an angularjs problem, but an API problem. If you were to change angular to only show one result, then you could only do so by changing the pagination options-- the number of items to show per page. The application would still query the full table, but only show one result.

The better approach would be to implement a “get products by user” along side your “get all products” on your API. Generally this is done by adding routes. Routes make the connection between your `switch($_GET['action'])` and your `get_product` function. I will be assuming there is a relationship between users and products, due to your “i want show only the data is of one person”. Then:

  1. Add parameters to your `get_products` method and connect it with your route:
    <?php
    switch($_GET['action'])  {
    	case 'get_product':
    		$user_id = array_key_exists('user_id', $_GET) ? $_GET['user_id'] : null;
    		get_product($user_id);
    		break;

     

  2. Modify the `get_product` SQL query to filter results by the `user_id`, if supplied. Prepared statements make this easy, but its not required:
    <?php
    $query = <<< SQL
    select s.*
    from   servicos s,
           user_servicos us
    where  us.product_id = s.id
    and    ( :user_id is null
    or        us.user_id = :user_id )
    SQL;

     

  3. Configure your angular app to query by `user_id`:
    $scope.get_product_by_user = function(user_id) {
    	$http.get('app/app.php?action=get_product&user_id='+user_id).success(function(data) {
    		// ...

     

Share this post


Link to post
Share on other sites

sorry i cant put it work

i make the changes but i can´t put it work

app.js

var app = angular.module('myApp', ['ui.bootstrap']);

app.filter('startFrom', function() {
	return function(input,start) {
		if (input) {
			start = +start;
			//parse to int
			return input.slice(start);
		}
		return [];
	}
});
app.controller('customersCrtl', function($scope, $http, $timeout) {

	//$scope.get_product = function() {
		
		$scope.get_product_by_user = function(user_id) {
	$http.get('app/app.php?action=get_product&user_id='+user_id).success(function(data) {
			//$scope.product_detail = data;
			$scope.list = data;
			$scope.currentPage = 1;
			//current page
			$scope.entryLimit = 5;
			//max no of items to display in a page
			$scope.filteredItems = $scope.list.length;
			//Initially for no filter
			$scope.totalItems = $scope.list.length;

		});
	//}
	}
	$scope.setPage = function(pageNo) {
		$scope.currentPage = pageNo;
	};
	$scope.filter = function() {
		$timeout(function() {
			$scope.filteredItems = $scope.filtered.length;
		}, 10);
	};
	$scope.sort_by = function(predicate) {
		$scope.predicate = predicate;
		$scope.reverse = !$scope.reverse;
	};

});

 

<?php

//Incluir definicoes de acesso a BD
require_once ('../configurations/Database.php');
//Incluir definicoes de acesso a BD

// algumas funcoes

 switch($_GET['action'])  {
  //  case 'add_product' :
    //        add_product();
      //      break;

        case 'get_product':
		$user_id = array_key_exists('user_id', $_GET) ? $_GET['user_id'] : null;
		get_product($user_id);
		break;

    case 'edit_product' :
            edit_product();
          break;

    ///case 'delete_product' :              
       //     delete_product();
         //   break;

   // case 'update_product' :
     //       update_product();
       //     break;
}
function get_product() {
	    
$link = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if (!$link) {
	die('Falha de ligacao a BD: ' . mysql_error());
}
/*$qry="select distinct c.nome,c.descricao,c.texto,c.categoria from  projecto c order by c.idprojecto";
$result = $link -> query($qry);
 
$arr = array();
if($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        $arr[] = $row;
    }
}else die("ERRO");
# JSON-encode the response
$json_response = json_encode($arr);
 
// # Return the response
echo $json_response;
*/

//$qry="select distinct c.nome,c.descricao,c.texto,c.categoria from  projecto c order by c.idprojecto";
  //$qry ="SELECT nome FROM servicos";
 // where id_empresa='" .$index. "'
 $qry ="SELECT id,nome,descricao,quantidade,precosiva,descontos,iva,valordesc,valoriva,precototal FROM servicos  where id_empresa='" .$user_id. "'";
 //$qry ="SELECT * FROM users";
   $result = $link -> query($qry);
    $data = array();
	 if ($result) {
     while($rows = $result->fetch_assoc()) 
    {
        $data[] = array(
        		"id" => $rows['id'],
                  "nome" => $rows['nome'],
                  "descricao" => $rows['descricao'],
				  "quantidade" => $rows['quantidade'],
                  "precosiva" => $rows['precosiva'],
                  "descontos" => $rows['descontos'],
                  "iva" => $rows['iva'],
                  "valordesc" => $rows['valordesc'],
                  "valoriva" => $rows['valoriva'],
                  "precototal" => $rows['precototal']);
    }
  print_r(json_encode($data));
    return json_encode($data);  


}
else 
die("ERRO". mysqli_error());
}
?>

index.php

!DOCTYPE html>
<html ng-app="myApp" lang="eng">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="Site de Contrução">
    <meta name="author" content="Pedro Alves">
    <link rel="icon" href="favicon.ico">
    <style>
		@media screen and (min-width: 780px) {
			.modal:before {
				display: inline-block;
				vertical-align: middle;
				content: " ";
				height: 15%;
			}
		}
		.modal-dialog {
			display: inline-block;
			/*text-align: left;*/
			vertical-align: middle;
		}
</style>
    <title>Trabalho </title>
    
 <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link href="dist/css/star-rating.css" media="all" rel="stylesheet" type="text/css"/>
    <!-- Bootstrap core CSS -->
    <link href="dist/css/bootstrap.min.css" rel="stylesheet">
<link href="dist/css/menu.css" rel="stylesheet">
<link href="dist/css/styleimage.css" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="dist/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="dist/css/starter-template.css" rel="stylesheet">
  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="dist/js/modernizr.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="dist/js/ui-bootstrap-tpls-0.10.0.min.js"></script>
<script type="text/javascript" src="dist/js/shCore.js"></script> 
<script type="text/javascript" src="dist/js/shBrushXml.js"></script> 
<script type="text/javascript" src="dist/js/shBrushJScript.js"></script>
    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="dist/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

<?php
include ('includes/menu.php');
require_once ('configurations/Database.php');
require_once ('classes/servicos.php');
$servicos = new servicos();
?>


        
        <div id="page-content-wrapper" style="height:550px">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                      <br>
                      <h1>   <img src="imagens/logo.ico">Trabalho</h1>
                      
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">

  <ul class="nav nav-pills nav-justified" >
    <li  class="active"><a data-toggle="pill" href="#home">Ferias</a></li>
    <li><a data-toggle="pill" href="#voos">Voos</a></li>
    <li><a data-toggle="pill" href="#hotel">Hotel</a></li>
    <li><a data-toggle="pill" href="#hotelvoos">Voos+Hotel</a></li>
    <li><a data-toggle="pill" href="#hotelvoos">Cruzeiros</a></li>
    <li><a data-toggle="pill" href="#hotelvoos">Cicuitos</a></li>
  </ul>
  
  <div class="tab-content">
    <div id="home" class="tab-pane fade in active">
    	<br>
   <form class="well form-horizontal" method="post"  name="pesquisas" id="pesquisas">
    <label class="control-label" style="color:#000">Pesquisar</label>
  
     <input class="form-horizontal" type="text" placeholder="What are searching for?" name="pes" id="pes" style="width: 200px">
      <span class="form-horizontal" style="width: 40px"><span class="glyphicon glyphicon-search" ></span> </span>
      <br>
      </form>
     <?php 
$ola= $servicos->getcontaempresa();
  $calcula=ceil(($ola/100)*10);
    
$i=1; 


if(isset($_GET['page'])==$i){
	$url=$_GET['page'];
	$mody=$url*10 - 10;
	//$servicos->getservicos($mody);
	 foreach ($servicos->getservicos($mody)as $m)://maybe the problem is becouse this 
	$d=$m['id'];
		 
	 ?>
      <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#<?php echo $d; ?>" ><?php echo $m['nome'];  ?></button>
  <!--script>
      var valor = <?php echo $d; ?>
       alert(valor);
</script-->
<div id="<?php echo $d; ?>"  class="modal fade" role="dialog" align="" >
  


    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
      </div>
      <div class="modal-body">
      	 <div class="row">
    <div class="col-sm-6">
     <p> LogoTipo</p>
      	<p><?php echo "Nif:", $m['nif'], " ";
		echo "CAE:", $m['CAE'];
 ?>
        	</p>
        
        <p><?php echo "Nome da Empresa:", $m['nome']; ?>
        	</p>
        	 <p><?php echo "Morada:", $m['morada']; ?>
        	</p>
        	 
        	<p><?php echo "Localidade:", $m['Localidade']; ?>
        	</p>
        	<p><?php echo "CodigoPostal:", $m['codigopostal']; ?>
        	</p>
        <p><?php echo "Telefone:", $m['telefone'], " ";
				echo "Fax:", $m['fax'], " ";
				echo "Telemovel:", $m['telemovel'];
 ?>
     
        	</p>
        	<p><?php echo "Webmail:", $m['email']; ?></p>
       <?php foreach ($servicos->getcategorias($d)as $n): ?>
         <p><?php echo "Categorias:", $n['nome']; ?></p>
     <?php endforeach ?>
    </div>
    <div class="col-sm-6">
    	
     <?php foreach ($servicos->getactividades($d)as $g): ?>
         <p><?php echo "Actividades:", $g['nome']; ?></p>
        
     <?php endforeach ?>
    
    </div>
       <div ng-controller="customersCrtl">
     
     
<br/>
<div class="row">
	
    <div class="col-md-12" ng-show="filteredItems > 0">
        <table class="table table-striped table-bordered">
  
        <thead>
        	<th style="visibility:collapse">ID </th>
         <th>Nome </th>
        <th>Descricao </th>
        <th>Quantidade </th>
       <th>Preco Sem Iva </th>
       <th>Descontos </th>
        <th>IVA </th>
         <th>Valor do Desconto </th>
 <th>Valor do IVA </th>         
   <th>Preço TOTAL </th>       
    <th>Ver</th>
        </thead>
     
        <tbody ng-init="get_product_by_user(1)">
           
            <tr ng-repeat="data in filtered =(list | filter:search | orderBy : predicate :reverse) |startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit">
             
           <!--tr-->
           		<td style="visibility:collapse">{{data.id}}</td>
      			<td>{{data.nome}}</td>
                <td>{{data.descricao}}</td>
                <td>{{data.quantidade}}</td>
                <td>{{data.precosiva}}</td>
                  <td>{{data.descontos}}</td>
                    <td>{{data.iva}}</td>
                     <td>{{data.valordesc}}</td>
                    <td>{{data.valoriva}}</td>
                    <td>{{data.precototal}}</td>
                   
               <td> <button class="btn" ng-click="prod_espiar(data.id)">
      <span class="glyphicon glyphicon-pencil"></span>  Selecionar
      </button>
      </td>
            
            </tr>
        </tbody>
        </table>
 
    </div>
    <div class="col-md-12" ng-show="filteredItems == 0">
        <div class="col-md-12">
            <h4>Nenhum Serviço Adecionado</h4>
        </div>
    </div>
 
  
    
</div> 
  </div>	 
  </div>
     
      
      </div>	
      <div class="modal-footer">
       <button type="button" class="btn btn-default" data-dismiss="modal">Sair</button>
      

      </div>
    </div>
</div>
<?php endforeach; ?>
<br>
<?php
echo "Tem ", $ola, " Dados ", "numero Total ", $calcula, " paginas";
}else{
$mody=0;

foreach ($servicos->getservicos1()as $m):
$d=$m['id'];
	 ?>
      <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#<?php echo $d;?>" ><?php echo $m['nome'];  ?></button>

<div id="<?php echo $d;?>"  class="modal fade" role="dialog" >
 

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close"  data-dismiss="modal">×</button>
      </div>
      <div class="modal-body">
      	 <div class="row">
    <div class="col-sm-6">
     <p> LogoTipo</p>
      	<p><?php echo "Nif:", $m['nif'], " ";
		echo "CAE:", $m['CAE'];
 ?>
        	</p>
        <p><?php echo "Nome da Empresa:", $m['nome']; ?>
        	</p>
        	 <p><?php echo "Morada:", $m['morada']; ?>
        	</p>
        	 
        	<p><?php echo "Localidade:", $m['Localidade']; ?>
        	</p>
        	<p><?php echo "CodigoPostal:", $m['codigopostal']; ?>
        	</p>
        <p><?php echo "Telefone:", $m['telefone'], " ";
				echo "Fax:", $m['fax'], " ";
				echo "Telemovel:", $m['telemovel'];
 ?>
        	</p>
        	<p><?php echo "Webmail:", $m['email']; ?></p>
       <?php foreach ($servicos->getcategorias($d)as $n): ?>
         <p><?php echo "Categorias:", $n['nome']; ?></p>
     <?php endforeach ?>
    </div>
    <div class="col-sm-6">
    	
     <?php foreach ($servicos->getactividades($d)as $g): ?>
         <p><?php echo "Actividades:", $g['nome']; ?></p>
     <?php endforeach ?>
     
    </div>
 <div ng-controller="customersCrtl">
     
     
<br/>
<div class="row">
	
    <div class="col-md-12" ng-show="filteredItems > 0">
        <table class="table table-striped table-bordered">
        
        <thead  >
        	<th style="visibility:collapse">ID </th>
         <th>Nome </th>
        <th>Descricao </th>
        <th>Quantidade </th>
       <th>Preco Sem Iva </th>
       <th>Descontos </th>
        <th>IVA </th>
         <th>Valor do Desconto </th>
 <th>Valor do IVA </th>         
   <th>Preço TOTAL </th>       
    <th>Ver</th>
        </thead>
        <tbody ng-init="get_product()">
           
            <tr ng-repeat="data in filtered  = (list | filter:search | orderBy : predicate :reverse) |startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit">
             
           <!--tr-->
           <td style="visibility:collapse">{{data.id}}</td>
      			<td>{{data.nome}}</td>
                <td>{{data.descricao}}</td>
                <td>{{data.quantidade}}</td>
                <td>{{data.precosiva}}</td>
                  <td>{{data.descontos}}</td>
                    <td>{{data.iva}}</td>
                     <td>{{data.valordesc}}</td>
                    <td>{{data.valoriva}}</td>
                    <td>{{data.precototal}}</td>
                   
               <td> <button class="btn" ng-click="prod_espiar(data.id)">
      <span class="glyphicon glyphicon-pencil"></span>  Selecionar
      </button>
      </td>
            
            </tr>
        </tbody>
        </table>
 
    </div>
    <div class="col-md-12" ng-show="filteredItems == 0">
        <div class="col-md-12">
            <h4>Nenhum projecto Adecionado</h4>
        </div>
    </div>
 
  
    
</div> 
  </div>
  </div>
     
      
      </div>	
      <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Sair</button>
      

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

<?php endforeach; ?>
<br>
<?php
echo "Tem ", $ola, " Dados ", "numero Total ", $calcula, " paginas";
}
?>
   <?php 
  while ($i <= $calcula){
?>
<br>
<ul class="pagination" id="page">
  <li><a href="?page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
 
</ul>
<?php

$i++;
}
//echo $calcula;
?>
    </div>
 
    <div id="voos" class="tab-pane fade">
      <div class="container" align="center">

        
<div class="well">
<div class="form-group" >
  <div class="input-group input-daterange">
  	<form class="well form-horizontal">
  	<input id="origems" name="origems" type="text" list="origem" placeholder="Origem" />
    <datalist id="origem">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist> 
<input type="text" list="destino"  class="form-horizontal" id="destinos" name="destinos" placeholder="destino"/>
   <datalist id="destino">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist> 
    <input id="DateBox1" class="form-horizontal" type="text" placeholder="Partida">
    <input id="DateBox2" class="form-horizontal" type="text" placeholder="Chegada">
    <input class="form-horizontal" data-toggle="modal" data-target="#myModal" type="text" placeholder="1 Adulto" readonly>
</div>
<div class="check">
<input id="endDay" type="checkbox">
<label for="endDay">Include end date in calculation (1 day is added)</label>
</div>          

<div class="col-xs-4">
<button type="button" class="btn btn-primary" id="submit">Calculate Intervals</button>
</div>
  
  <div class="col-xs-4 col-xs-offset-2">
<div class="current-date">
<span></span>
</div>
 </div>
<br><br>
  <hr>

<table width="100%">
  <tbody><tr><td class="table_left" width="33%">Number of Full years</td><td class="table_right"><span class="years-between"></span></td></tr>
<tr><td class="table_left" width="33%">Number of Months</td><td class="table_right"><span class="months-between"></span></td></tr>
<tr><td class="table_left" width="33%">Number of Weeks</td><td class="table_right"><span class="weeks-between"></span></td></tr>
<tr><td class="table_left" width="33%">Number of Days</td><td class="table_right"><span class="days-between"></span></td></tr>
  </tbody></table>
</div>
</div>





            <div id="push"></div>
      </form> 
      </div> 
    </div>
    <div id="hotel" class="tab-pane fade">
      <h3>Hotel</h3>
      <input id="input-21e" value="1" type="text" class="rating" data-min=0 data-max=5 data-step=1 data-size="xs"
               title="">
       </div>
    
  </div>
</div>
<br>
<br>



    </div>
</div>

</div>
<?php
include ('includes/footer.php');
 ?>

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

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h4 class="modal-title">Modal Header</h4>
      </div>
      <div class="modal-body">
        <p>Some text in the modal.</p>
      </div>
      <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Sair</button>
        <button type="button" class="btn btn-primary">Salvar</button>

      </div>
    </div>

  </div>
</div>
<!-- Modal -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script--> 
    <!--script>window.jQuery || document.write('<script src="dist/js/jquery.min.js"><\/script>')</script-->
    <script src="dist/js/bootstrap.min.js"></script>
    <!-- Just to make our placeholder images work. Don't actually copy the next line! -->
    <script src="dist/js/holder.min.js"></script>
   
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="dist/js/ie10-viewport-bug-workaround.js"></script>
    
      <script src="dist/js/bootstrapValidator.js"></script>
   <script src="dist/js/bootstrapValidator.min.js"></script>
  <script src="dist/js/star-rating.js"></script>
      <script src="dist/js/pick.js"></script>
<script src = "dist/js/mapas.js"></script> 

  </body>
</html>

 


 

Edited by Landi20

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this