{"action":"created","comment":{"url":"https://api.github.com/repos/leamarty/cursoweb/pulls/comments/45160764","id":45160764,"diff_hunk":"@@ -0,0 +1,355 @@\n+<!DOCTYPE html>\n+<html lang=\"en\">\n+<head>\n+    <title>La web del curso</title>\n+    <meta charset=\"UTF-8\">\n+    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n+    <link type=\"text/css\" rel=\"stylesheet\" href=\"estilos.css\"/>\n+    <script src=\"bower_components/jquery/dist/jquery.min.js\"></script>\n+    <link rel=\"stylesheet\" href=\"bower_components/bootstrap/dist/css/bootstrap.min.css\">\n+    <script src=\"bower_components/bootstrap/dist/js/bootstrap.min.js\"></script>\n+    <script>\n+\n+        $(document).ready(function () {\n+\n+            var tablas_cargadas = 0;\n+\n+            function habilitar_boton() {\n+                if (++tablas_cargadas == 2) {\n+                    if (clientes_agotados == 1) {\n+                        clientes_agotados = 0;\n+                    }\n+                    tablas_cargadas = 0;\n+                    $(\"#boton-buscar\").removeAttr(\"disabled\");\n+                }\n+            }\n+\n+            var clientes_agotados = 0;\n+\n+            function verificar_clientes_agotados() {\n+                if (++clientes_agotados == 2) {\n+                    clientes_agotados = 0;\n+                    mostrar_alert(\"listado\", \"agotado\");\n+                }\n+            }\n+\n+            function mostrar_alert(tab, id) {\n+                $(\"div#alerts-container-\" + tab).children(\"div:not(#\" + id + \")\").hide().parent().children(\"div#\" + id).show();\n+            }\n+\n+            mostrar_alert(\"listado\", \"realice-busqueda\");\n+            mostrar_alert(\"nuevo\", \"este-div-no-existe-lalala\");\n+\n+            function pedir_clientes(paridad) {\n+\n+                var desde = 1;\n+                var a = $('table#tabla-clientes-' + paridad + ' > tbody').children('tr');\n+                if (a.length > 0) {\n+                    desde = parseInt(a.first().find(\"td\")[1].textContent) + 1;\n+                }\n+\n+                $.getJSON(\n+                        \"clientes.php\",\n+                        {\n+                            desde: desde,\n+                            cantidad: 5,\n+                            filtro: paridad\n+\n+                        }).fail(function () {\n+                            mostrar_alert(\"listado\", \"error\");\n+                            habilitar_boton();\n+\n+                        }).done(function (json) {\n+                            var tabla_temporal = $(\"<tbody>\");\n+                            $(json).each(function () {\n+                                $(tabla_temporal).prepend(\n+                                        $(\"<tr>\").append(\n+                                                $(\"<td>\").addClass(\"text-center\").append(\n+                                                        $(\"<img>\").attr(\"src\", this.logo.replace(\"w=32\", \"w=36\").replace(\"h=32\", \"h=36\"))\n+                                                ),\n+                                                $(\"<td>\").addClass(\"text-center\").text(this.id),\n+                                                $(\"<td>\").text(this.razonSocial),\n+                                                $(\"<td>\").addClass(\"visible-lg\").text(this.direccion.calle + \" \" + this.direccion.altura + \", \" + this.direccion.ciudad),\n+                                                $(\"<td>\").text(this.presidente.nombre + \" \" + this.presidente.apellido),\n+                                                $(\"<td>\").addClass(\"text-right\").addClass(this.activo >= this.pasivo ? \"success\" : \"danger\").text(\"$ \" + (this.activo - this.pasivo).toFixed(2)),\n+                                                // $(\"<td>\").addClass(\"visible-lg\").text(this.fechaCreacion)\n+                                                $(\"<td>\").addClass(\"text-center\").append(\n+                                                        $(\"<button>\").addClass(\"btn btn-danger boton-borrar\").append(\n+                                                                $(\"<span>\").addClass(\"glyphicon glyphicon-remove\")\n+                                                        )\n+                                                ).attr(\"data-toggle\", \"tooltip\").attr(\"title\", \"Este proceso es irreversible\").attr(\"data-placement\", \"left\")\n+                                        ).children(\"td\").addClass(\"vcenter\").parent()\n+                                )\n+                            });\n+                            $(\"table#tabla-clientes-\" + paridad).children(\"tbody\").prepend($(tabla_temporal).html());\n+                            bindear_botones_borrar();\n+\n+                            if (json.length < 5) {\n+                                verificar_clientes_agotados();\n+                            }\n+                            habilitar_boton();\n+                        });\n+            }\n+\n+            $(\"#boton-buscar\").click(function () {\n+\n+                $(this).attr(\"disabled\", \"\");\n+                mostrar_alert(\"listado\", \"comprobando-disponibilidad\");\n+\n+                $.ajax({\n+                    url: \"http://ccvalsina.com/cursoweb/autorizacion.php\",\n+                    type: \"GET\",\n+                    cache: false,\n+\n+                    error: function () {\n+                        mostrar_alert(\"listado\", \"ocupado\");\n+                        $(\"#boton-buscar\").removeAttr(\"disabled\");\n+                        // borrar el siguiente for cuando vuelva internet y descomentar la linea de arriba\n+                        /* for (var paridad in {\"impar\": \"\", \"par\": \"\"}) {\n+                            pedir_clientes(paridad);\n+                        } */\n+                    },\n+\n+                    success: function () {\n+                        mostrar_alert(\"listado\", \"disponible\");\n+                        for (var paridad in {\"impar\": \"\", \"par\": \"\"}) {\n+                            pedir_clientes(paridad);\n+                        }\n+                    }\n+                });\n+            });\n+\n+            function borrar_cliente (element) {\n+\n+                $.ajax({\n+                    url: \"clientes.php\",\n+                    type: \"DELETE\",\n+                    data: {\n+                        id: $(element).parents(\"tr\").children(\"td\")[1].textContent\n+                    },\n+\n+                    error: function () {\n+                        mostrar_alert(\"listado\", \"error\");\n+                        $(element).removeAttr(\"disabled\");\n+                    },\n+\n+                    success: function () {\n+                        $(element).parents(\"tr\").remove();\n+                    }\n+                });\n+            }\n+\n+            function bindear_botones_borrar() {\n+                $(\"button.boton-borrar\").off(\"click\").on(\"click\", function () {","path":"M3/practica/index.html","position":143,"original_position":143,"commit_id":"3a0bcb855e3fd690cb00dbbacf94dc7065237dc8","original_commit_id":"3a0bcb855e3fd690cb00dbbacf94dc7065237dc8","user":{"login":"leamarty","id":3124547,"avatar_url":"https://avatars.githubusercontent.com/u/3124547?v=3","gravatar_id":"","url":"https://api.github.com/users/leamarty","html_url":"https://github.com/leamarty","followers_url":"https://api.github.com/users/leamarty/followers","following_url":"https://api.github.com/users/leamarty/following{/other_user}","gists_url":"https://api.github.com/users/leamarty/gists{/gist_id}","starred_url":"https://api.github.com/users/leamarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leamarty/subscriptions","organizations_url":"https://api.github.com/users/leamarty/orgs","repos_url":"https://api.github.com/users/leamarty/repos","events_url":"https://api.github.com/users/leamarty/events{/privacy}","received_events_url":"https://api.github.com/users/leamarty/received_events","type":"User","site_admin":false},"body":"También podés usar la función ````.data()```` (al momento de armar la tabla) y seguir bindeando todos juntos","created_at":"2015-11-18T05:11:57Z","updated_at":"2015-11-18T05:11:57Z","html_url":"https://github.com/leamarty/cursoweb/pull/18#discussion_r45160764","pull_request_url":"https://api.github.com/repos/leamarty/cursoweb/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/leamarty/cursoweb/pulls/comments/45160764"},"html":{"href":"https://github.com/leamarty/cursoweb/pull/18#discussion_r45160764"},"pull_request":{"href":"https://api.github.com/repos/leamarty/cursoweb/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/leamarty/cursoweb/pulls/18","id":51039083,"html_url":"https://github.com/leamarty/cursoweb/pull/18","diff_url":"https://github.com/leamarty/cursoweb/pull/18.diff","patch_url":"https://github.com/leamarty/cursoweb/pull/18.patch","issue_url":"https://api.github.com/repos/leamarty/cursoweb/issues/18","number":18,"state":"open","locked":false,"title":"convierte clientes.php en restful","user":{"login":"dragonnegro78","id":15573422,"avatar_url":"https://avatars.githubusercontent.com/u/15573422?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonnegro78","html_url":"https://github.com/dragonnegro78","followers_url":"https://api.github.com/users/dragonnegro78/followers","following_url":"https://api.github.com/users/dragonnegro78/following{/other_user}","gists_url":"https://api.github.com/users/dragonnegro78/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonnegro78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonnegro78/subscriptions","organizations_url":"https://api.github.com/users/dragonnegro78/orgs","repos_url":"https://api.github.com/users/dragonnegro78/repos","events_url":"https://api.github.com/users/dragonnegro78/events{/privacy}","received_events_url":"https://api.github.com/users/dragonnegro78/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-18T03:38:56Z","updated_at":"2015-11-18T05:11:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a55fd347cec82193cdfaca546a3b95096aa58905","assignee":{"login":"dragonnegro78","id":15573422,"avatar_url":"https://avatars.githubusercontent.com/u/15573422?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonnegro78","html_url":"https://github.com/dragonnegro78","followers_url":"https://api.github.com/users/dragonnegro78/followers","following_url":"https://api.github.com/users/dragonnegro78/following{/other_user}","gists_url":"https://api.github.com/users/dragonnegro78/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonnegro78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonnegro78/subscriptions","organizations_url":"https://api.github.com/users/dragonnegro78/orgs","repos_url":"https://api.github.com/users/dragonnegro78/repos","events_url":"https://api.github.com/users/dragonnegro78/events{/privacy}","received_events_url":"https://api.github.com/users/dragonnegro78/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/leamarty/cursoweb/pulls/18/commits","review_comments_url":"https://api.github.com/repos/leamarty/cursoweb/pulls/18/comments","review_comment_url":"https://api.github.com/repos/leamarty/cursoweb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leamarty/cursoweb/issues/18/comments","statuses_url":"https://api.github.com/repos/leamarty/cursoweb/statuses/3a0bcb855e3fd690cb00dbbacf94dc7065237dc8","head":{"label":"leamarty:ale-convierto-controller-a-restful","ref":"ale-convierto-controller-a-restful","sha":"3a0bcb855e3fd690cb00dbbacf94dc7065237dc8","user":{"login":"leamarty","id":3124547,"avatar_url":"https://avatars.githubusercontent.com/u/3124547?v=3","gravatar_id":"","url":"https://api.github.com/users/leamarty","html_url":"https://github.com/leamarty","followers_url":"https://api.github.com/users/leamarty/followers","following_url":"https://api.github.com/users/leamarty/following{/other_user}","gists_url":"https://api.github.com/users/leamarty/gists{/gist_id}","starred_url":"https://api.github.com/users/leamarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leamarty/subscriptions","organizations_url":"https://api.github.com/users/leamarty/orgs","repos_url":"https://api.github.com/users/leamarty/repos","events_url":"https://api.github.com/users/leamarty/events{/privacy}","received_events_url":"https://api.github.com/users/leamarty/received_events","type":"User","site_admin":false},"repo":{"id":45354198,"name":"cursoweb","full_name":"leamarty/cursoweb","owner":{"login":"leamarty","id":3124547,"avatar_url":"https://avatars.githubusercontent.com/u/3124547?v=3","gravatar_id":"","url":"https://api.github.com/users/leamarty","html_url":"https://github.com/leamarty","followers_url":"https://api.github.com/users/leamarty/followers","following_url":"https://api.github.com/users/leamarty/following{/other_user}","gists_url":"https://api.github.com/users/leamarty/gists{/gist_id}","starred_url":"https://api.github.com/users/leamarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leamarty/subscriptions","organizations_url":"https://api.github.com/users/leamarty/orgs","repos_url":"https://api.github.com/users/leamarty/repos","events_url":"https://api.github.com/users/leamarty/events{/privacy}","received_events_url":"https://api.github.com/users/leamarty/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leamarty/cursoweb","description":"","fork":false,"url":"https://api.github.com/repos/leamarty/cursoweb","forks_url":"https://api.github.com/repos/leamarty/cursoweb/forks","keys_url":"https://api.github.com/repos/leamarty/cursoweb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leamarty/cursoweb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leamarty/cursoweb/teams","hooks_url":"https://api.github.com/repos/leamarty/cursoweb/hooks","issue_events_url":"https://api.github.com/repos/leamarty/cursoweb/issues/events{/number}","events_url":"https://api.github.com/repos/leamarty/cursoweb/events","assignees_url":"https://api.github.com/repos/leamarty/cursoweb/assignees{/user}","branches_url":"https://api.github.com/repos/leamarty/cursoweb/branches{/branch}","tags_url":"https://api.github.com/repos/leamarty/cursoweb/tags","blobs_url":"https://api.github.com/repos/leamarty/cursoweb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leamarty/cursoweb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leamarty/cursoweb/git/refs{/sha}","trees_url":"https://api.github.com/repos/leamarty/cursoweb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leamarty/cursoweb/statuses/{sha}","languages_url":"https://api.github.com/repos/leamarty/cursoweb/languages","stargazers_url":"https://api.github.com/repos/leamarty/cursoweb/stargazers","contributors_url":"https://api.github.com/repos/leamarty/cursoweb/contributors","subscribers_url":"https://api.github.com/repos/leamarty/cursoweb/subscribers","subscription_url":"https://api.github.com/repos/leamarty/cursoweb/subscription","commits_url":"https://api.github.com/repos/leamarty/cursoweb/commits{/sha}","git_commits_url":"https://api.github.com/repos/leamarty/cursoweb/git/commits{/sha}","comments_url":"https://api.github.com/repos/leamarty/cursoweb/comments{/number}","issue_comment_url":"https://api.github.com/repos/leamarty/cursoweb/issues/comments{/number}","contents_url":"https://api.github.com/repos/leamarty/cursoweb/contents/{+path}","compare_url":"https://api.github.com/repos/leamarty/cursoweb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leamarty/cursoweb/merges","archive_url":"https://api.github.com/repos/leamarty/cursoweb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leamarty/cursoweb/downloads","issues_url":"https://api.github.com/repos/leamarty/cursoweb/issues{/number}","pulls_url":"https://api.github.com/repos/leamarty/cursoweb/pulls{/number}","milestones_url":"https://api.github.com/repos/leamarty/cursoweb/milestones{/number}","notifications_url":"https://api.github.com/repos/leamarty/cursoweb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leamarty/cursoweb/labels{/name}","releases_url":"https://api.github.com/repos/leamarty/cursoweb/releases{/id}","created_at":"2015-11-01T19:27:51Z","updated_at":"2015-11-01T21:54:18Z","pushed_at":"2015-11-18T03:38:58Z","git_url":"git://github.com/leamarty/cursoweb.git","ssh_url":"git@github.com:leamarty/cursoweb.git","clone_url":"https://github.com/leamarty/cursoweb.git","svn_url":"https://github.com/leamarty/cursoweb","homepage":null,"size":2627,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"leamarty:practica-modulo3","ref":"practica-modulo3","sha":"a7f04ce6a42ef0fd91531c3c111cf8054b7f4b84","user":{"login":"leamarty","id":3124547,"avatar_url":"https://avatars.githubusercontent.com/u/3124547?v=3","gravatar_id":"","url":"https://api.github.com/users/leamarty","html_url":"https://github.com/leamarty","followers_url":"https://api.github.com/users/leamarty/followers","following_url":"https://api.github.com/users/leamarty/following{/other_user}","gists_url":"https://api.github.com/users/leamarty/gists{/gist_id}","starred_url":"https://api.github.com/users/leamarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leamarty/subscriptions","organizations_url":"https://api.github.com/users/leamarty/orgs","repos_url":"https://api.github.com/users/leamarty/repos","events_url":"https://api.github.com/users/leamarty/events{/privacy}","received_events_url":"https://api.github.com/users/leamarty/received_events","type":"User","site_admin":false},"repo":{"id":45354198,"name":"cursoweb","full_name":"leamarty/cursoweb","owner":{"login":"leamarty","id":3124547,"avatar_url":"https://avatars.githubusercontent.com/u/3124547?v=3","gravatar_id":"","url":"https://api.github.com/users/leamarty","html_url":"https://github.com/leamarty","followers_url":"https://api.github.com/users/leamarty/followers","following_url":"https://api.github.com/users/leamarty/following{/other_user}","gists_url":"https://api.github.com/users/leamarty/gists{/gist_id}","starred_url":"https://api.github.com/users/leamarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leamarty/subscriptions","organizations_url":"https://api.github.com/users/leamarty/orgs","repos_url":"https://api.github.com/users/leamarty/repos","events_url":"https://api.github.com/users/leamarty/events{/privacy}","received_events_url":"https://api.github.com/users/leamarty/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leamarty/cursoweb","description":"","fork":false,"url":"https://api.github.com/repos/leamarty/cursoweb","forks_url":"https://api.github.com/repos/leamarty/cursoweb/forks","keys_url":"https://api.github.com/repos/leamarty/cursoweb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leamarty/cursoweb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leamarty/cursoweb/teams","hooks_url":"https://api.github.com/repos/leamarty/cursoweb/hooks","issue_events_url":"https://api.github.com/repos/leamarty/cursoweb/issues/events{/number}","events_url":"https://api.github.com/repos/leamarty/cursoweb/events","assignees_url":"https://api.github.com/repos/leamarty/cursoweb/assignees{/user}","branches_url":"https://api.github.com/repos/leamarty/cursoweb/branches{/branch}","tags_url":"https://api.github.com/repos/leamarty/cursoweb/tags","blobs_url":"https://api.github.com/repos/leamarty/cursoweb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leamarty/cursoweb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leamarty/cursoweb/git/refs{/sha}","trees_url":"https://api.github.com/repos/leamarty/cursoweb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leamarty/cursoweb/statuses/{sha}","languages_url":"https://api.github.com/repos/leamarty/cursoweb/languages","stargazers_url":"https://api.github.com/repos/leamarty/cursoweb/stargazers","contributors_url":"https://api.github.com/repos/leamarty/cursoweb/contributors","subscribers_url":"https://api.github.com/repos/leamarty/cursoweb/subscribers","subscription_url":"https://api.github.com/repos/leamarty/cursoweb/subscription","commits_url":"https://api.github.com/repos/leamarty/cursoweb/commits{/sha}","git_commits_url":"https://api.github.com/repos/leamarty/cursoweb/git/commits{/sha}","comments_url":"https://api.github.com/repos/leamarty/cursoweb/comments{/number}","issue_comment_url":"https://api.github.com/repos/leamarty/cursoweb/issues/comments{/number}","contents_url":"https://api.github.com/repos/leamarty/cursoweb/contents/{+path}","compare_url":"https://api.github.com/repos/leamarty/cursoweb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leamarty/cursoweb/merges","archive_url":"https://api.github.com/repos/leamarty/cursoweb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leamarty/cursoweb/downloads","issues_url":"https://api.github.com/repos/leamarty/cursoweb/issues{/number}","pulls_url":"https://api.github.com/repos/leamarty/cursoweb/pulls{/number}","milestones_url":"https://api.github.com/repos/leamarty/cursoweb/milestones{/number}","notifications_url":"https://api.github.com/repos/leamarty/cursoweb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leamarty/cursoweb/labels{/name}","releases_url":"https://api.github.com/repos/leamarty/cursoweb/releases{/id}","created_at":"2015-11-01T19:27:51Z","updated_at":"2015-11-01T21:54:18Z","pushed_at":"2015-11-18T03:38:58Z","git_url":"git://github.com/leamarty/cursoweb.git","ssh_url":"git@github.com:leamarty/cursoweb.git","clone_url":"https://github.com/leamarty/cursoweb.git","svn_url":"https://github.com/leamarty/cursoweb","homepage":null,"size":2627,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leamarty/cursoweb/pulls/18"},"html":{"href":"https://github.com/leamarty/cursoweb/pull/18"},"issue":{"href":"https://api.github.com/repos/leamarty/cursoweb/issues/18"},"comments":{"href":"https://api.github.com/repos/leamarty/cursoweb/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/leamarty/cursoweb/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/leamarty/cursoweb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leamarty/cursoweb/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/leamarty/cursoweb/statuses/3a0bcb855e3fd690cb00dbbacf94dc7065237dc8"}}}}