{"action":"created","issue":{"url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/115","labels_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/115/comments","events_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/115/events","html_url":"https://github.com/thedigicraft/Atom.CMS/issues/115","id":64101174,"number":115,"title":"Part 85 - Navigation Editor Query ","user":{"login":"fazer06","id":11637521,"avatar_url":"https://avatars.githubusercontent.com/u/11637521?v=3","gravatar_id":"","url":"https://api.github.com/users/fazer06","html_url":"https://github.com/fazer06","followers_url":"https://api.github.com/users/fazer06/followers","following_url":"https://api.github.com/users/fazer06/following{/other_user}","gists_url":"https://api.github.com/users/fazer06/gists{/gist_id}","starred_url":"https://api.github.com/users/fazer06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fazer06/subscriptions","organizations_url":"https://api.github.com/users/fazer06/orgs","repos_url":"https://api.github.com/users/fazer06/repos","events_url":"https://api.github.com/users/fazer06/events{/privacy}","received_events_url":"https://api.github.com/users/fazer06/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-24T21:14:58Z","updated_at":"2015-03-25T20:05:44Z","closed_at":null,"body":"Hi all. This isn't really an issue because i've just finished the whole project, but its regarding Part 85 - when we started to build the navigation form, and it was mentioned about adding to the navigation. Since the project has ended has anybody successfully got that part working ? \r\n\r\nI've been looking at it for a few hours now and i can't figure out how to add a new record. When i look at it with firebug all i can see is undefined indexes and an error in my SQL syntax, because its using the update, not the INSERT that i've put within an else, also the ajax is being called. So, i'm a bit stuck and if anybody has successfully got this part figured out, could you share your code please ?\r\n\r\nRegards\r\nShaun"},"comment":{"url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/comments/86198279","html_url":"https://github.com/thedigicraft/Atom.CMS/issues/115#issuecomment-86198279","issue_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/115","id":86198279,"user":{"login":"fazer06","id":11637521,"avatar_url":"https://avatars.githubusercontent.com/u/11637521?v=3","gravatar_id":"","url":"https://api.github.com/users/fazer06","html_url":"https://github.com/fazer06","followers_url":"https://api.github.com/users/fazer06/followers","following_url":"https://api.github.com/users/fazer06/following{/other_user}","gists_url":"https://api.github.com/users/fazer06/gists{/gist_id}","starred_url":"https://api.github.com/users/fazer06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fazer06/subscriptions","organizations_url":"https://api.github.com/users/fazer06/orgs","repos_url":"https://api.github.com/users/fazer06/repos","events_url":"https://api.github.com/users/fazer06/events{/privacy}","received_events_url":"https://api.github.com/users/fazer06/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T20:05:44Z","updated_at":"2015-03-25T20:05:44Z","body":"Thanks for that, Jason. I've almost got it working, can you guys see anything wrong with this code ?\r\n\r\n<div class=\"row\">\r\n    <div class=\"col-md-4 col-md-offset-1\">\r\n        \r\n        <h1>Add To Navigation</h1>\r\n        <form class=\"form-horizontal nav-form\" action=\"index.php?page=navigation&id=<?php echo $opened['id']; ?>\" method=\"post\" role=\"form\">\r\n\r\n            <div class=\"form-group\">\r\n                <label for=\"label\">Label for menu link:</label>\r\n                <input type=\"text\" class=\"form-control\" name=\"label\" id=\"label\" placeholder=\"Label for link\" autocomplete=\"off\">\r\n            </div>\r\n\r\n            <div class=\"form-group\">\r\n                <label for=\"url\">URL for menu link:</label>\r\n                <input type=\"text\" class=\"form-control\" name=\"url\" id=\"url\" placeholder=\"URL Link Path\" autocomplete=\"off\">\r\n            </div>\r\n\r\n            <div class=\"form-group\">\r\n                <label for=\"icon\">Icon for menu link:</label>\r\n                <input type=\"text\" class=\"form-control\" name=\"icon\" id=\"icon\" placeholder=\"fa fa-envelope\" autocomplete=\"off\">\r\n            </div>\r\n\r\n            <div class=\"form-group\">\r\n                <label for=\"position\">Sorted by Position:</label>\r\n                <input type=\"text\" class=\"form-control\" name=\"position\" id=\"position\" placeholder=\"Items are sorted by position\" autocomplete=\"off\">\r\n            </div>\r\n            \r\n            <div class=\"form-group\">\r\n                <label for=\"status\">Enable link. (0 - 1):</label>\r\n                <input type=\"text\" class=\"form-control\" name=\"status\" id=\"status\" placeholder=\"Include status to enable link. (0 - 1)\" autocomplete=\"off\">\r\n            </div>\r\n\r\n          <button type=\"submit\" name=\"submit\" class=\"submit btn btn-default\">Add to Navigation</button>\r\n          <input type=\"hidden\" name=\"submitted\" value=\"2\">\r\n          \r\n        </form>\r\n        \r\n    </div><!-- ./col-md-4 col-md-offset-1 -->\r\n    \r\n    \r\n    <div class=\"col-md-4 col-md-offset-1\">\r\n        <h1 class=\"margin-bottom-30\">Sort Navigation</h1>\r\n        <?php \r\n        $query = \"SELECT * FROM navigation ORDER BY position ASC\";\r\n        $result = mysqli_query($connection, $query);\r\n        \r\n        while ($opened = mysqli_fetch_assoc($result)) { ?>\r\n        \r\n        <ul id=\"sort-nav\" class=\"list-group\">\r\n            \r\n            <li id=\"list_<?php echo $opened['id']; ?>\" class=\"list-group-item\">\r\n                <a id=\"label_<?php echo $opened['id']; ?>\" data-toggle=\"collapse\" data-target=\"#form_<?php echo $opened['id']; ?>\">\r\n                <?php echo $opened['label']; ?> <i class=\"fa fa-chevron-down\"></i>\r\n                </a>\r\n                <div id=\"form_<?php echo $opened['id']; ?>\" class=\"collapse\">\r\n                    \r\n                <form id=\"nav_<?php echo $opened['id']; ?>\" class=\"form-horizontal nav-form\" action=\"index.php?page=navigation&id=<?php echo $opened['id']; ?>\" method=\"post\" role=\"form\">\r\n\r\n                    <div class=\"form-group\">                        \r\n                        <label class=\"col-sm-2 control-label\" for=\"id\">ID:</label>\r\n                        <div class=\"col-sm-10\">\r\n                            <input type=\"text\" class=\"form-control input-sm\" name=\"id\" id=\"id\" value=\"<?php echo $opened['id']; ?>\" placeholder=\"id-name\" autocomplete=\"off\">\r\n                        </div>                        \r\n                    </div>\r\n\r\n                    <div class=\"form-group\">                        \r\n                        <label class=\"col-sm-2 control-label\" for=\"label\">Label:</label>\r\n                        <div class=\"col-sm-10\">\r\n                            <input type=\"text\" class=\"form-control input-sm\" name=\"label\" id=\"label\" value=\"<?php echo $opened['label']; ?>\" placeholder=\"Label\" autocomplete=\"off\">\r\n                        </div>                        \r\n                    </div>\r\n\r\n                    <div class=\"form-group\">                       \r\n                        <label class=\"col-sm-2 control-label\" for=\"url\">URL:</label>\r\n                        <div class=\"col-sm-10\">\r\n                            <input type=\"text\" class=\"form-control input-sm\" name=\"url\" id=\"url\" value=\"<?php echo $opened['url']; ?>\" placeholder=\"URL\" autocomplete=\"off\">\r\n                        </div>                        \r\n                    </div>\r\n                    \r\n                    <div class=\"form-group\">                       \r\n                        <label class=\"col-sm-2 control-label\" for=\"url\">Icon:</label>\r\n                        <div class=\"col-sm-10\">\r\n                            <input type=\"text\" class=\"form-control input-sm\" name=\"icon\" id=\"icon\" value=\"<?php echo htmlentities($opened['icon']); ?>\" placeholder=\"Icon\" autocomplete=\"off\">\r\n                        </div>                        \r\n                    </div>\r\n\r\n                    <div class=\"form-group\">                        \r\n                        <label class=\"col-sm-2 control-label\" for=\"status\">Status:</label>\r\n                        <div class=\"col-sm-10\">\r\n                            <input type=\"text\" class=\"form-control input-sm\" name=\"status\" id=\"status\" value=\"<?php echo $opened['status']; ?>\" placeholder=\"\" autocomplete=\"off\">\r\n                        </div>                        \r\n                    </div>\r\n\r\n                    <button type=\"submit\" class=\"submit btn btn-default\">Update</button>\r\n                    <input type=\"hidden\" name=\"submitted\" value=\"1\">\r\n                    <input type=\"hidden\" name=\"openedid\" value=\"<?php echo $opened['id']; ?>\">\r\n                    <button id=\"del_<?php echo $opened['id']; ?>\" class=\"btn-delete-nav btn btn-danger\"><i class=\"fa fa-trash-o\"></i></button>\r\n                </form>\r\n                \r\n                </div>\r\n            </li>\r\n            \r\n        <?php } ?>\r\n            \r\n        </ul>\r\n    </div><!-- ./col-md-4 col-md-offset-1 -->\r\n</div><!-- ./row -->\r\n\r\nAs of now i can add and delete, the sort is working but i can't get the update to work, can you spot anything ?\r\n"}}