#main_header > .container {
padding: 0;
margin: 0;
max-width: 100%;
}
h2.pull-right.toggle {
padding: 0px 15px;
margin: 13px 0 12px;
}
.head_btn .publish {
float: right;
padding-top: 0;
}
body.has-searchbox.home {
padding-top: 45px;
}
#main_header {
position: fixed;
top: 0;
}
var express = require('express');
var routes = require('./routes/index');
var api = require('./routes/api');
var app = express();
app.use('/', routes);
app.use('/api', api);
var express = require('express');
var router = express.Router();
router.get('/doc/all', function(req, res) {
var query = "SELECT * FROM lectures";
db.query(query,function(err,rows){
if (!err) {
console.log("User request all Docs");
res.json(rows);
}
else
console.log('Error while performing Query.');
});
});
router.get('/doc/:docId/answers', function(req, res) {
var query = "SELECT answers.vopr_id AS qid, answers.id, " +
"answers.text AS atext, answers.sequence, answers.truth " +
"FROM answers, questions " +
"WHERE answers.vopr_id = questions.id " +
"AND questions.doc_id = ?";
var docID = [req.params.docId];
console.log("User request answers for document with ID: " + req.params.docId);
query = mysql.format(query,docID);
db.query(query,function(err,rows){
if (!err)
res.json(rows);
else
console.log('Error while performing Query.');
});
});
module.exports = router;
for (var i = arr.length-10; i < arr.length; i++) {
...
}
if(arr.length > 10) {
for (var i = arr.length-10; i < arr.length; i++) {
...
}
}
else {
for (var i = 0; i < arr.length; i++) {
...
}
}
var arr = userInfo.results.reverse();
var arr = userInfo.results;
var obj = {
"id": 1,
"name": "Lake1",
"audio1": "qwe",
"audio2": "qwe",
"images": [
{
"id": 1,
"file_name": "/images/66acc105-1c06-45aa-a3b8-5_S3USvg3.png"
}],
"images2":
[
{
"id": 1,
"file_name": "/images/66acc105-1c06-45aa-a3b8-5_S3USvg3.png"
},
{
"id": 2,
"file_name": "/images/66acc105-1c06-45aa-a3b8-5_S3USvg3.png"
}
]
}
obj.images.images2 = obj.images2;
delete obj.images2;
{
"id": 1,
"name": "Lake1",
"audio1": "qwe",
"audio2": "qwe",
"images": [
{
"id": 1,
"file_name": "/images/66acc105-1c06-45aa-a3b8-5_S3USvg3.png",
"images2":
[
{
"id": 1,
"file_name": "/images/66acc105-1c06-45aa-a3b8-5_S3USvg3.png"
},
{
"id": 2,
"file_name": "/images/66acc105-1c06-45aa-a3b8-5_S3USvg3.png"
}
]
}]
}