Landi20

Members
  • Content count

    141
  • Joined

  • Last visited

Community Reputation

257 Neutral

About Landi20

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. pagination don´t work

    i cant put my pagination work this is my code what i doing wrong <div ng-app="sa_app" ng-controller="controller" ng-init="show_data()"> <div class="col-md-3">Filter: <input type="text" ng-model="search" ng-change="filter()" placeholder="Filter" class="form-control" /> </div> <div class="col-md-4"> <h5>Filtered {{ filtered.length }} of {{ totalItems}} total Servicos</h5> </div> <div> <table class="table table-bordered"> <tr> <th>Id</th> <th>Nome</th> <th>Descricao</th> <th>Quantidade</th> <th>Nome da Empresa</th> <th>Preço Sem Iva</th> <th>Descontos</th> <th>IVA</th> <th>Valor Desc</th> <th>Valor IVA</th> <th>Preco Total</th> <th>Edit</th> <th>Delete</th> </tr> <tr ng-repeat="x in filtered = (names | filter:search | orderBy : predicate :reverse) |startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit"> <td>{{x.id}}</td> <td>{{x.nome}}</td> <td>{{x.descricao}}</td> <td>{{x.quantidade}} Unidade</td> <td>{{x.Nome}}</td> <td>{{x.precosiva}}€</td> <td>{{x.descontos}}%</td> <td>{{x.iva}}%</td> <td>{{x.valordesc}}€</td> <td>{{x.valoriva}}€</td> <td>{{x.precototal}}€</td> <td> <button class="btn btn-success btn-xs" data-toggle="modal" data-target="#myModal1" ng-click="update_data(x.id, x.nome, x.descricao, x.quantidade,x.Nome,x.precosiva,x.descontos,x.iva)"> <span class="glyphicon glyphicon-edit"></span> Edit </button> </td> <td> <button class="btn btn-danger btn-xs" ng-click="delete_data(x.id )"> <span class="glyphicon glyphicon-trash"></span> Delete </button> </td> </tr> </table> </div> <div class="col-md-12" ng-show="filteredItems == 0"> <div class="col-md-12"> <h4>No serviços found</h4> </div> </div> <div class="col-md-12" ng-show="filteredItems > 0"> <?php echo "OLA";?> {{ filteredItems}} <div pagination="" page="currentPage" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="&laquo;" next-text="&raquo;"></div> </div> </div> </div> </div> </div> </div> <script> var app = angular.module("sa_app", []); /*app.filter('startFrom', function() { return function(input,start) { if (input) { start = +start; //parse to int return input.slice(start); } return []; } }); */ app.filter('startFrom', function() { return function(input, start) { if(input) { start = +start; //parse to int return input.slice(start); } return []; } }); app.controller("controller", function($scope, $http,$timeout) { $scope.btnName = "Insert"; $scope.insert = function() { if ($scope.nome == null) { alert("Insira o nome do Servico"); } else if ($scope.descricao == null) { alert("Insira a descricao"); } else if ($scope.quantidade == null) { alert("insira a quantidade"); } else if ($scope.Nome == null) { alert("insira a Nome da Empresa"); } else if ($scope.precosiva == null) { alert("insira a O Valor do Preço"); } else if ($scope.descontos == null) { alert("insira a O Valor do Desconto"); } else if ($scope.iva == null) { alert("insira a O Valor do IVA"); } else { $http.post( "servicos/insert.php", { 'nome': $scope.nome, 'descricao': $scope.descricao, 'quantidade': $scope.quantidade, 'Nome': $scope.Nome, 'precosiva': $scope.precosiva, 'descontos': $scope.descontos, 'iva': $scope.iva, 'btnName': $scope.btnName, 'id': $scope.id } ).success(function(data) { alert(data); $scope.nome = null; $scope.descricao = null; $scope.quantidade = null; $scope.Nome=null; $scope.precosiva = null; $scope.descontos = null; $scope.iva = null; $scope.btnName = "Insert"; $scope.show_data(); }); } } $scope.show_data = function() { $http.get("servicos/display.php") .success(function(data) { $scope.names = data; $scope.currentPage = 1; //current page $scope.entryLimit = 5; //max no of items to display in a page $scope.filteredItems = $scope.names.length; //Initially for no filter $scope.totalItems = $scope.names.length; }); } $scope.show_data1 = function() { $http.get("servicos/display1.php") .success(function(data) { $scope.names1 = data; }); } $scope.update_data = function(id,nome,descricao,quantidade,Nome,precoiva,descontos,iva) { $scope.id = id; $scope.nome = nome; $scope.descricao =descricao; $scope.quantidade = quantidade; $scope.Nome=Nome; $scope.precosiva = precoiva; $scope.descontos= descontos; $scope.iva = iva; $scope.btnName = "Update"; } $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.delete_data = function(id) { if (confirm("Are you sure you want to delete?")) { $http.post("servicos/delete.php", { 'id': id }) .success(function(data) { // alert(data); $scope.show_data(); }); } else { return false; } } }); </script>
  2. google map don´t work

    how i put this downloadUrl('', function(data) { to load a php file i have try put like this downloadUrl('map.php?Nome=<?php echo $m;?>', function(data) { and not work
  3. google map don´t work

    i can´t put work my map load the correctly with data it is in my data base what i doing wrong index.php <?php foreach ($servicos->getnomeempresa($m['Nome'])as $emp1): $dom = new DOMDocument("1.0"); $node = $dom->createElement("markers"); $parnode = $dom->appendChild($node); $node = $dom->createElement("marker"); $newnode = $parnode->appendChild($node); $newnode->setAttribute("name", $emp1['Nome']); $newnode->setAttribute("address", $emp1['morada']); $newnode->setAttribute("lat", $emp1['lat']); $newnode->setAttribute("lng", $emp1['lng']); $newnode->setAttribute("type",$emp1['type']); echo $dom->saveXML(); endforeach; //$xmlfile = $doc->dump_mem(); ?> index.php <script> var customLabel = { restaurant: { label: 'R' }, bar: { label: 'B' } }; function initMap() { var map = new google.maps.Map(document.getElementById('map'), { center: new google.maps.LatLng(-33.863276, 151.207977), zoom: 12 }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP or XML file downloadUrl('', function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName('marker'); Array.prototype.forEach.call(markers, function(markerElem) { var name = markerElem.getAttribute('name'); var address = markerElem.getAttribute('address'); var type = markerElem.getAttribute('type'); var point = new google.maps.LatLng( parseFloat(markerElem.getAttribute('lat')), parseFloat(markerElem.getAttribute('lng'))); var infowincontent = document.createElement('div'); var strong = document.createElement('strong'); strong.textContent = name infowincontent.appendChild(strong); infowincontent.appendChild(document.createElement('br')); var text = document.createElement('text'); text.textContent = address infowincontent.appendChild(text); var icon = customLabel[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, label: icon.label }); marker.addListener('click', function() { infoWindow.setContent(infowincontent); infoWindow.open(map, marker); }); }); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} </script>
  4. select value with angular problem

    i find the soluction thanks
  5. i can´t insert a value of my select option in my querry this is my code what i doing wrong this is my code <div ng-app="sa_app" ng-controller="controller" ng-init="show_data()"> <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">&times;</button> </div> <div class="modal-body"> <label>Nome do Servico</label> <input type="text" name="nome" ng-model="nome" class="form-control"> <br/> <label>Descrição</label> <input type="text" name="descricao" ng-model="descricao" class="form-control"> <br/> <label>Quantidade</label> <input type="text" name="quantidade" ng-model="quantidade" class="form-control"> <br/> <label>Nome da Empresa</label> <div ng-app="sa_app" ng-controller="controller" ng-init="show_data1()"> <select name="Nome" ng-model="Nome" class="form-control"> <option ng-repeat="x in name" value="{{x.Nome}}">{{x.Nome}}</option> </select> </div> <!--input type="text" name="Nome" ng-model="Nome" class="form-control"--> <br/> <label>Preço Sem iva</label> <input type="text" name="precosiva" ng-model="precosiva" class="form-control"> <br/> <label>Descontos</label> <input type="text" name="descontos" ng-model="descontos" class="form-control"> <br/> <label>IVA</label> <input type="text" name="iva" ng-model="iva" class="form-control"> <br/> <input type="hidden" ng-model="id"> <!--input type="submit" name="insert" class="btn btn-primary" ng-click="insert()" value="{{btnName}}"--> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Sair</button> <button type="button" class="btn btn-primary" name="insert" ng-click="insert()" value="{{btnName}}" data-dismiss="modal">Insert</button> </div> </div> </div> </div> <script> var app = angular.module("sa_app", []); app.controller("controller", function($scope, $http) { $scope.btnName = "Insert"; $scope.insert = function() { if ($scope.nome == null) { alert("Insira o nome do Servico"); } else if ($scope.descricao == null) { alert("Insira a descricao"); } else if ($scope.quantidade == null) { alert("insira a quantidade"); /*} else if ($scope.Nome == null) { alert("insira a Nome da Empresa"); */ } else if ($scope.precosiva == null) { alert("insira a O Valor do Preço"); } else if ($scope.descontos == null) { alert("insira a O Valor do Desconto"); } else if ($scope.iva == null) { alert("insira a O Valor do IVA"); } else { $http.post( "servicos/insert.php", { 'nome': $scope.nome, 'descricao': $scope.descricao, 'quantidade': $scope.quantidade, 'Nome': $scope.Nome, 'precosiva': $scope.precosiva, 'descontos': $scope.descontos, 'iva': $scope.iva, 'btnName': $scope.btnName, 'id': $scope.id } ).success(function(data) { //alert(data); $scope.nome = null; $scope.descricao = null; $scope.quantidade = null; $scope.Nome=null; $scope.precosiva = null; $scope.descontos = null; $scope.iva = null; $scope.btnName = "Insert"; $scope.show_data(); }); } } $scope.show_data = function() { $http.get("servicos/display.php") .success(function(data) { $scope.names = data; }); } $scope.show_data1 = function() { $http.get("servicos/display1.php") .success(function(data) { $scope.name = data; }); } $scope.update_data = function(id,nome,descricao,quantidade,Nome,precoiva,descontos,iva) { $scope.id = id; $scope.nome = nome; $scope.descricao =descricao; $scope.quantidade = quantidade; $scope.Nome=Nome; $scope.precosiva = precoiva; $scope.descontos= descontos; $scope.iva = iva; $scope.btnName = "Update"; } $scope.delete_data = function(id) { if (confirm("Are you sure you want to delete?")) { $http.post("servicos/delete.php", { 'id': id }) .success(function(data) { // alert(data); $scope.show_data(); }); } else { return false; } } }); </script> <?php require_once ('../../configurations/config.php'); $conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE); $info = json_decode(file_get_contents("php://input")); if (count($info) > 0) { $nome = mysqli_real_escape_string($conn, $info->nome); $descricao = mysqli_real_escape_string($conn, $info->descricao); $quantidade = mysqli_real_escape_string($conn, $info->quantidade); $nomeempr = mysqli_real_escape_string($conn, $info->Nome); $precoiva = mysqli_real_escape_string($conn, $info->precosiva); $descontos = mysqli_real_escape_string($conn, $info->descontos); $iva = mysqli_real_escape_string($conn, $info->iva); $btn_name = $info->btnName; if ($btn_name == "Insert") { $query = "INSERT INTO servicos(nome, descricao, quantidade, id_empresa, precosiva, descontos, iva) VALUES ('$nome', '$descricao', '$quantidade',(SELECT id from empresa where Nome='$nomeempr'), '$precoiva', '$des','$iva')"; if (mysqli_query($conn, $query)) { echo "Data Inserted Successfully..."; } else { echo 'Failed'; } } if ($btn_name == 'Update') { $id = $info->id; $query = "UPDATE servicos SET name = '$nome', descricao = '$descricao', quantidade = '$quantidade', quantidade = '$quantidade',id_empresae = '$nomeempr',precosiva = '$precoiva',descontos = '$des',iva = '$iva' WHERE id = '$id'"; if (mysqli_query($conn, $query)) { echo 'Data Updated Successfully...'; } else { echo 'Failed'; } } } ?>
  6. problem with angularjs

    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>
  7. problem with angularjs

    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"); } */ ?>
  8. PlayerController Question

    I using this tutorial to make my game if want to use the playerController like this toturial My question i only have to port my input from character class to my playercontroller
  9. Jornal Widget Problem

    i find the soluction the problem is in my pickup class
  10. Jornal Widget Problem

    i find the problem i forget the update my quest now i have a other problem i use this tutorial to make my pickup system to this tutorial now i part have to pickup a quest item and i can´t put to work do i have to create other actor to use to the quest item i can add to inventory but can´t update my quest i think my problem is in pickup class link to googledrive https://drive.google.com/open?id=0B11O6ZMrJmMOMEZyU3VHSFFpMjA
  11. Jornal Widget Problem

    i have problem when i click the button to show details of quest the widget disapers what i doing wrong this is the link to project https://drive.google.com/open?id=0B11O6ZMrJmMOT2kzNHVGN2R1b1k
  12. craft system problem

    i find the soluction i make a newbie mistake i forget the connect the the foreachloop with breake in array element i forget the connect the array element to current amount and requeried amount
  13. craft system problem

    i can´t put my craft working the material don´t update in craft widget MasterItem.h USTRUCT(BlueprintType) struct Finventoryslot : public FTableRowBase {     GENERATED_BODY() public:     UPROPERTY(EditAnywhere, BlueprintReadWrite)         TSubclassOf<class AMasterItem>ItemClass;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         int32 Amount; }; "LegendOfArthurCharacter.h USTRUCT(BlueprintType) struct FInventoryItem : public FTableRowBase {     GENERATED_BODY() public:     /*FInventoryItem() {     Name = FText::FromString("Item");     Action = FText::FromString("Use");     Description = FText::FromString("Please Enter a description for this item");     Value = 10;     }     */     UPROPERTY(EditAnywhere, BlueprintReadWrite)         FName ItemID;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         FText Name;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         FText Action;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         int32 Value;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         UTexture2D * thumbnail;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         FText Description;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         Category Category;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         Rank Ranks;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         bool canbeStack;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         TArray<Finventoryslot>Recepie;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         bool bCanBeUsed;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         EnumSlots EnumSlots;     UPROPERTY(EditAnywhere, BlueprintReadWrite)         FString internalName; }; i put the blueprints and widgets in googledrive i using this tuturial https://www.youtube.com/watch?v=Fs0p4pPf9m8&index=20&list=PLmKKTERcjTPKEPl0nk48Tpmj-iWmzqo_Q#t=9.483922 https://drive.google.com/open?id=0B11O6ZMrJmMORkw1bWRQZmd2RFk what i doing wrong
  14. change umg unreal engine by c++

    The problem is only happen when i try login for the secound time i think the problem is in this function void UGameSparksStatics::LoginSucessDetails_Response(GameSparks::Core::GS & gs, const GameSparks::Api::Responses::AccountDetailsResponse & resp) {     if (inicialized) {         if (!resp.GetHasErrors()) {             /***********************************************************************/             if (theWorld->GetGameInstance())             {                 UStateManager *manager = Cast<UStateManager>(theWorld->GetGameInstance());                 if (manager)                 {                     manager->ChangeState(EGameState::EServerScreen);                 }             } /****************************************************************************************/             else             {                 if (GEngine) {                     GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::MakeRandomColor(), TEXT("Accounts Details Request Fail"));                 }             }         }     } } becouse i call a fuction like this the gameengine never crash i think the gameparks don´t like when have change the gamestats void UGameSparksStatics::LoginSucessDetails_Response(GameSparks::Core::GS & gs, const GameSparks::Api::Responses::AccountDetailsResponse & resp) {     if (inicialized) {         if (!resp.GetHasErrors()) {             if (GEngine) {             GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::MakeRandomColor(),resp.GetJSONString().c_str());             }             else             {                 if (GEngine) {                     GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::MakeRandomColor(), TEXT("Accounts Details Request Fail"));                 }             }         }     } }
  15. change umg unreal engine by c++

    now i have other problem when i try login the game and exit and try make login for the secound time the game crash give this error what i doing wrong and this is the link to my project https://www.dropbox.com/sh/ay42hi5u7npwf8n/AAB0lDrJ6VjKQ2pVL4wcCP8Sa?dl=0 Access violation - code c0000005 (first/second chance not available) UE4Editor_CoreUObject UE4Editor_RPG_4849!UGameSparksStatics::LoginSucessDetails_Response() [c:\users\pedro\documents\unreal projects\rpg\source\rpg\gamesparksstatics.cpp:48] UE4Editor_RPG_4849!GameSparks::Core::GSTypedRequest<GameSparks::Api::Requests::AccountDetailsRequest,GameSparks::Api::Responses::AccountDetailsResponse>::Callbacks::OnSucess() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\include\gamesparks\gstypedrequest.h:113] UE4Editor_GameSparks!GameSparks::Core::GSRequest::Complete() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gsrequest.cpp:83] UE4Editor_GameSparks!GameSparks::Core::GS::ProcessReceivedResponse() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gs.cpp:510] UE4Editor_GameSparks!GameSparks::Core::GS::ProcessReceivedItem() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gs.cpp:565] UE4Editor_GameSparks!GameSparks::Core::GS::OnMessageReceived() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gs.cpp:164] UE4Editor_GameSparks!GameSparks::Core::GSConnection::OnWebSocketCallback() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gsconnection.cpp:129] UE4Editor_GameSparks!`anonymous namespace'::_RealWebSocket::_dispatch() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\easywsclient\easywsclient.cpp:649] UE4Editor_GameSparks!GameSparks::Core::GSConnection::Update() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gsconnection.cpp:160] UE4Editor_GameSparks!GameSparks::Core::GS::UpdateConnections() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparksbasesdk\src\gamesparks\gs.cpp:314] UE4Editor_GameSparks!UGameSparksModule::Tick() [c:\users\pedro\documents\unreal projects\rpg\plugins\gamesparks\source\gamesparks\private\gamesparksmodule.cpp:66] UE4Editor_Engine UE4Editor_UnrealEd UE4Editor_UnrealEd UE4Editor UE4Editor UE4Editor UE4Editor UE4Editor kernel32 ntdll