The bootbox dialog window doesn't show - php

I want to delete user with bootbox dialog window but when i click remove button the bootbox dialog window doesn't show. I wrote a simple program. Here is my codes:
Before i confirm in libraries:
<head>
<title>Adminstration</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="bootbox.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
My html code like this:
<form id="form1" action="footer.php">
<div class="body-wrap" id="wrapper" style="overflow: auto;">
<div class="container" id="container" style=" margin-top: 40px;">
<div class="well col-xs-8 col-sm-8 col-md-8 col-lg-8 col-xs-offset-2 col-sm-offset-2 col-md-offset-2 col-lg-offset-2" id="well">
<?php $arr = array(1, 2, 3, 4); foreach ($arr as $value)
{ $value = $value * 2;
?>
<div class="row user-row" style="border-bottom: 1px solid #ddd;">
<div class="col-xs-8 col-sm-9 col-md-10 col-lg-10">
<strong><?php echo $value ?></strong><br>
<span class="text-muted">Value: <?php echo $value; ?> </span>
</div>
<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dropdown-user pull-right" data-for=".<?php echo $value; ?>">
<i class="glyphicon glyphicon-chevron-down text-muted "></i>
</div>
</div>
<div class="row user-infos <?php echo $value; ?>" id="user-infos">
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10 col-xs-offset-0 col-sm-offset-0 col-md-offset-1 col-lg-offset-1" id="col-xs">
<div class="panel panel-primary" id="panel">
<div class="panel-heading">
<h2 class="panel-title" style="text-align: center;">user info</h2>
</div>
<div class="panel-body">
<div class="row-fluid">
<div class="span6">
<h3> <?php echo $value ?> </h3><br>
</div>
</div>
</div>
<div class="panel-footer clearfix" id="footer">
<span>
<a class="delete_user btn btn-danger btn-sm pull-right" id="del" href="" data-toggle="tooltip" title="Delete user"><span class="glyphicon glyphicon-remove"></span></a>
</span >
</div>
</div>
</div>
</div><?php } ?>
</div>
</div>
</div>
</form>
And js code:
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
/************************USERS********************************/
$(document).ready(function() {
var panels = $('.user-infos');
var panelsButton = $('.dropdown-user');
panels.hide();
//Click dropdown
panelsButton.click(function() {
//get data-for attribute
var dataFor = $(this).attr('data-for');
var idFor = $(dataFor);
//current button
var currentButton = $(this);
idFor.slideToggle(400, function() {
//Completed slidetoggle
if(idFor.is(':visible'))
{
currentButton.html('<i class="glyphicon glyphicon-chevron-up text-muted"></i>');
}
else
{
currentButton.html('<i class="glyphicon glyphicon-chevron-down text-muted"></i>');
}
})
});
});
/********************************************************/
/************************DELETE USERS*************************************/
$(document).ready(function(){
$('.delete_user#del').click(function(e){
e.preventDefault();
bootbox.dialog({
message: "<i class='fa fa-warning fa-2x' style='color: orange;'></i><span style='font-size:16px; position: absolute; margin-left: 5px; margin-top: 5px;'>Are you sure to delete this user?</span>",
title: "<i class='glyphicon glyphicon-trash'></i> Delete user!",
buttons: {
danger: {
label: "Delete!",
className: "btn-danger",
callback: function() {/*some code*/}
},
success: {
label: "No",
className: "btn-success",
callback: function() {
$('.bootbox').modal('hide');
}
}
}
});
});
});
/*******************************************************************/
This js code for bootbox dialog is work another php file but doesn't work for this php file.

Related

Regarding HTML5canvas div images to download individually

I need help i want to download the htmlf 5 canvas for each individuall and im calling the image data dynamic but not been able to download the canvas plzz help me out from such informartion through my code in future user may add as many template images it will be called with same design as i have called data dynamically so im not getting what to do for download the canvas for such div images can anyone help me out
if ($sImage)
{
$gallery = get_field('field_5ea2b74754193');
?>
<div class="row">
<?php
$counter=1;
$canvas=1;
foreach ($gallery as $value) { ?>
<div class="col-sm-4">
<div class="onethird">
<center>
<h2>Design-<?php echo $counter++;?></h2><br>
<div class="my_banner" id="myCanvas <?php echo $canvas; ?>">
<div class="template_bg" style="background-image: url(<?php echo $sImage?>);">
<!--php echo '<img src="'.$sImage.'" class="absolute img-fluid" />'; ?-->
<img src="<?php echo $value['full_image_url'];?>" class="relative img-fluid" />
</div>
</div>
<div>
<br>
<a id="download" href="#" class="dowload btn btn-danger">Download</a>
</div>
</center>
</div>
</div>
<?php $canvas++; } ?>
<script>
$(document).ready(function() {
var canvas_id=0;
$('a.dowload').click(function(e){
e.preventDefault();
alert('Download on process');
html2canvas($('#myCanvas'),{
onrendered: function (canvas) {
var a = document.createElement('a');
a.href = canvas.toDataURL("image/png");
alert(a.href);
a.download = 'my-image.png';
a.click();
}
});
});
});
</script>
</div>
</div>
<?php
}
I have used a modal box for my issue to get the work to be done in proper work for converting Div images to html2canvas to create one image and download the image side by side
if ($sImage)
{
$gallery = get_field('field_5ea2b74754193');
?>
<div class="row">
<?php
$counter=1;
foreach ($gallery as $key=> $value) {?>
<div class="col-sm-4">
<div class="onethird">
<center>
<h2>Design-<?php echo $counter++;?></h2><br>
<div class="my_banner" id="myCanvas_<?php echo $value['id']; ?>">
<div class="template_bg" style="background-image: url(<?php echo $sImage?>);">
<img src="<?php echo $value['full_image_url'];?>" class="relative img-fluid" />
</div>
</div>
<div>
<br>
<!-- Preview -->
<div class="qrcimg mt-3" data-toggle="modal" data-target="#myModal">
<input id="preview_box" type="button" data-id="<?php echo $value['id'];?>" name="canvas_id" value="Get Image" class="preview_box btn btn-outline-primary"/>
</div>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-center" style="color:black; font-weight:bold;">SlashDP</h4>
<button type="button" class="close" data-dismiss="modal" style="font-size:2rem;">×</button>
</div>
<div class="modal-body">
<div id="canvas_image" data-id="<?php echo $value['id'];?>"></div>
<center><a id="download" href="#" class="clear btn btn-danger"><i class="fa fa-download" style="font-size:1rem;"> Download</i></a></center>
</div>
</div>
</div>
</div>
</div>
</center>
</div>
</div>
<?php } ?>
<!-- Canvas image get preview and download code -->
<script>
$(document).ready(function() {
// Global variable
var getCanvas;
$(".preview_box").on('click', function() {
var dataId = $(this).attr("data-id");
var canvas_img = $("#myCanvas_"+dataId).get(0);
html2canvas(canvas_img,{
useCORS: true,
allowTaint: false,
letterRendering: true,
logging:true,
onrendered: function(canvas) {
$("#canvas_image").append(canvas);
getCanvas = canvas;
console.log(canvas);
}
});
});
$("#download").on('click', function() {
var imageData =getCanvas.toDataURL("image/png");
// Now browser starts downloading
// it instead of just showing it
var newData = imageData.replace(/^data:image\/png/, "data:application/octet-stream");
$("#download").attr("download", "my-demo.png").attr("href", newData);
});
jQuery(".clear").click(function(){ jQuery("#canvas_image").empty();});
jQuery(".close").click(function(){ jQuery("#canvas_image").empty();});
});
</script>
</div>
</div>**

How to get dropped div name jquery drag and drop

This is continuation of my question first question
Here i am drag and drop sticky notes from one to another. i have
<div class="rTable">
<div class="rTableRow">
<div id="a" title="Backog" class="rTableHead rTabletd"><strong>Backlog</strong></div>
<div id="a" title="WIP" class="rTableHead rTabletd"><span style="font-weight: bold;">WIP</span></div>
<div id="a" title="Testing" class="rTableHead rTabletd">Testing</div>
<div id="a" title="DOD" class="rTableHead rTabletd">DOD</div>
</div>
<div class="rTableRow rTableh" >
<div class="rTableCell"></div>
<div class="rTableCell"><a></a></div>
<div class="rTableCell"></div>
<div class="rTableCell"></div>
</div>
</div>
and sticky notes
<?php
foreach ($this->getallstores as $stories):
?>
<div id="draggable-<?php echo $stories['id']; ?>" class="draggable " onchange="javascript:position(this)" style="position:absolute; left: <?php echo $stories['_left']; ?>px; top: <?php echo $stories['_top']; ?>px">
<img class="pin" src="/manage/public/img/pin.png" alt="pin" />
<blockquote class="quote-box note-<?php echo $stories['color']; ?>">
<p class="quote-text" id="content-<?php echo $stories['id'];?>">
<?php echo $stories['message']; ?>
</p>
<hr>
<div class="blog-post-actions">
<p>
<button class="btn btn-primary popEdit pull-left" data-toggle='tooltip' title="Edit" onClick="popOverEdit(<?php echo $stories['id'];?>)" id="pop-<?php echo $stories['id'];?>"><span class="glyphicon glyphicon-edit"></span></button>
<div class="popover-markup blog-post-bottom" >
<div class="head hide">Edit</div>
<div class="content hide" id="popoverContent<?php echo $stories['id'];?>">
<div class="form-group">
<textarea id="<?php echo $stories['id']; ?>" class="quick" ><?php echo $stories['message']; ?></textarea>
</div>
<button data-vendor-id="" data-act="send" onClick="getText(<?php echo $stories['id'];?>)" class="btn btn-info save_notes">Save</button>
</div>
</div>
</p>
<p class="blog-post-bottom pull-right">
<a class="delete" href="?delete=<?php echo $stories['id']; ?>" style="float:right"> <button class="btn btn-danger" title="delete"><span class="glyphicon glyphicon-trash"></span></button> </a>
</p>
</div>
</blockquote>
</div>
<?php endforeach;?>
demo
my requirement is i want to drag and drop stickys and save to database.Now i have save position.is there any way to save column name?eg if drag sticky note from backlog to testing how can i get placed position name is testing?Please help me.
jquery
jQuery(function() {
jQuery( ".draggable" ).draggable({ containment: "#containment-wrapper", scroll: false ,
// Find position where image is dropped.
stop: function(event, ui) {
// Show dropped position.
var id=$(this).attr('id');
var ti=$(".rTabletd").attr("title");
var Stoppos = $(this).position();
model = {
id:id,
left: Stoppos.left,
top: Stoppos.top
};
$.ajax({
url: "/scrum/save",
type: "post",
data: model,
success: function(data){
jQuery.HP({
title: "Success!",
message: "Saved..."
});
},
error:function(){
// alert('error is saving');
}
});
}
});
});
You can create an array and use the droppable index position to select the array value.
var table = ['Backlog', 'WIP', 'Testing', 'DOD'];
$(".rTableCell > div").draggable();
$(".rTableCell").droppable({
drop: function(event, ui) {
var table = ['Backlog', 'WIP', 'Testing', 'DOD'];
var droppedOn = event.target;
alert(table[$(droppedOn).index()]);
}
});
.rTableHead,
.rTableCell {
display: inline-block;
width: 23%;
}
.rTableCell {
border: 1px solid black;
height: 100vh;
}
.rTableCell>div {
background-color: blue;
padding: 5px;
color: white;
border-radius: 5px;
margin: 5px;
cursor: pointer;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
<div class="rTable">
<div class="rTableRow">
<div id="backlog" title="Backog" class="rTableHead rTabletd"><strong>Backlog</strong></div>
<div id="WIP" title="WIP" class="rTableHead rTabletd"><span style="font-weight: bold;">WIP</span></div>
<div id="TESTING" title="Testing" class="rTableHead rTabletd"><span style="font-weight: bold;">Testing</span></div>
<div id="DOD" title="DOD" class="rTableHead rTabletd"><span style="font-weight: bold;">DOD</span></div>
</div>
<div class="rTableRow rTableh">
<div class="rTableCell">
<div>
Item 1
</div>
</div>
<div class="rTableCell">
<div>
Item 2
</div>
</div>
<div class="rTableCell">
<div>
Item 3
</div>
</div>
<div class="rTableCell">
<div>
Item 4
</div>
</div>
</div>
</div>

Nothing happens when submitting form

I am new in Codeigniter and I have gone through its documentation. I'm trying to submit a form which is in HTML and jQuery but once I click the submit button nothing happens and my code seems fine. I also have a date and time picker which I would like to ask: should I store both in one column with a date and time as its type? or should they be stored separately?
Here is my view:
<link href="<?php echo base_url() ?>assets/css/bootstrap-timepicker.min.css" rel="stylesheet">
<link href="<?php echo base_url() ?>assets/css/datepicker3.css" rel="stylesheet">
<link href="<?php echo base_url() ?>assets/tagsinput/bootstrap-tagsinput.css" rel="stylesheet">
<script type="text/javascript" src="<?php echo base_url() ?>assets/js/bootstrap-timepicker.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/js/typeahead.js/bloodhound.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/js/typeahead.js/typeahead.bundle.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/js/typeahead.js/typeahead.jquery.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/tagsinput/bootstrap-tagsinput-angular.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/tagsinput/bootstrap-tagsinput.min.js"></script>
<button class="btn btn-primary btn-xs pull-right" data-toggle="modal" data-target="#myModal">
Send Message
</button>
<style type="text/css">
.modal-backdrop{z-index: 1200;}
.modal{z-index: 1201;}
.tt-dropdown-menu{z-index: 1203; border: solid 1px #CCC; margin-right: 0; margin-left: 0; background-color: #fff; border-color: #ddd; border-width: 1px; border-radius: 4px 4px 0 0; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; -webkit-box-shadow: none; box-shadow: none;}
.tt-suggestions{}
</style>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="z-index: 9999;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Send Message</h4>
</div>
<div class="modal-body">
<form name="SendSMSForm" id="SendSMSForm" action="<?phpecho form_open('comments/create_comment'); ?>" class="form-horizontal" role="form" method="post">
<div class="form-group">
<label class="col-sm-2 control-label">Sender</label>
<div class="col-sm-10">
<p class="form-control-static"><label class="label label-primary">Inclusion</label></p>
</div>
</div>
<div class="form-group">
<label for="recepients" class="col-sm-2 control-label">To</label>
<div class="col-sm-10">
<input class="form-control" id="recepients" type="text" placeholder="" name="recepients" >
<p class="help-block">
<small>
Enter name of person/group in address-book E.g John, Family, Workmates
</small>
</p>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-2 control-label">Message</label>
<div class="col-sm-10">
<textarea class="form-control" name="body" rows="3"></textarea>
</div>
</div>
<a data-toggle="collapse" data-parent="#accordion" href="#SendSMSOptions">
<span class="glyphicon glyphicon-plus"></span> Options
</a>
<div id="SendSMSOptions" class="panel-collapse collapse in">
<div class="panel-body">
<div class="form-group">
<label for="recepients" class="col-sm-2 control-label">Schedule Send</label>
<div class="col-sm-10">
<br />
<div class="input-group date">
<input data-provide="datepicker" name="datepicker" type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
<div class="input-group bootstrap-timepicker">
<input id="timepicker" data-template="modal" name="timepicker" type="text" class="form-control">
<span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="SendSMS">Send Now</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('.collapse').collapse();
$('#timepicker').timepicker({showMeridian: false, minuteStep: 15, defaultTime: 'current'});
$('.input-group.date').datepicker({
format: 'mm/dd/yyyy',
startDate: '-3d',
autoclose: true,
todayHighlight: true
});
$("#SendSMS").click(function () {
event.preventDefault();
var postData = $('#SendSMSForm').serializeArray();
$.post("<?php echo base_url('messages/send') ?>", postData)
.done(function (data) {
alert("Data Loaded: " + data);
});
});
});
var cities = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: '<?php echo base_url("c_contacts/index/cities") ?>'
});
cities.initialize();
var elt = $('#recepients');
elt.tagsinput({
tagClass: function(item) {
switch (item.continent) {
case 'Europe' :
return 'label label-primary';
case 'America' :
return 'label label-danger label-important';
case 'Australia':
return 'label label-success';
case 'Africa' :
return 'label label-default';
case 'Asia' :
return 'label label-warning';
}
},
itemValue: 'value',
itemText: 'text'
});
/*
elt.tagsinput('add', {"value": 1, "text": "Amsterdam", "continent": "Europe"});
elt.tagsinput('add', {"value": 4, "text": "Washington", "continent": "America"});
elt.tagsinput('add', {"value": 7, "text": "Sydney", "continent": "Australia"});
elt.tagsinput('add', {"value": 10, "text": "Beijing", "continent": "Asia"});
elt.tagsinput('add', {"value": 13, "text": "Cairo", "continent": "Africa"});
*/
elt.tagsinput('input').typeahead(null, {
name: 'cities',
displayKey: 'text',
source: cities.ttAdapter()
}).bind('typeahead:selected', $.proxy(function(obj, datum) {
this.tagsinput('add', datum);
this.tagsinput('input').typeahead('val', '');
}, elt));
});
</script>
Your line:
<form name="SendSMSForm" id="SendSMSForm" action="<?phpecho form_open('comments/create_comment'); ?>" class="form-horizontal" role="form" method="post">
should not have form_open in action attribute. This will only generate the following:
<form name="SendSMSForm" id="SendSMSForm" action="<form action="http://localhost/comments/create_comment" method="post" accept-charset="utf-8">
" class="form-horizontal" role="form" method="post">
form_open() is a native CI helper and helps you generate a form tag.
https://www.codeigniter.com/userguide3/helpers/form_helper.html?highlight=form_open#form_open
Here's the proper syntax:
form_open($action = '', $attributes = array(), $hidden = array())
To create a form tag, you should do this:
<!-- Remove the form tag and use CI's form helper -->
<?php echo form_open(NULL, array('name'=>'SendSMSForm', 'id'=>'SendSMSForm', 'class'=>'form-horizontal', 'role'=>'form')); ?>
This should generate the following:
<form action="http://localhost/" name="SendSMSForm" id="SendSMSForm" class="form-horizontal" role="form" method="post" accept-charset="utf-8">
This is a CodeIgniter way. You can still use the <form> tag.

Using AJAX for passing form inputs in CodeIgniter

I'm a newbie in CodeIgniter and I'm trying to pass my form inputs from the view to the controller. I was able to pass it, and was able to insert it on the database. However, I want to use Ajax for this so the whole page won't reload when I press the submit button. I have watched and tried this youtube tutorial: https://www.youtube.com/watch?v=IURutxKvukA, but it doesn't work for me. :( Thank you in advance!
This is my controller, Teacher.php
public function insert_quiz($quiztitle, $quizdescription, $value="")
{
$data = $this->input->post();
$numData = count($data);
$response = array();
$stringChoices = "";
if($numData > 1)
{
for ($i=4; $i < $numData; $i++)
{
$num = $i-3;
$offset = "inputChoice$num";
if ($i == 4)
{
$stringChoices = $data[$offset];
}
else if ($i != 4)
{
$stringChoices = $stringChoices . "," . $data[$offset];
}
}
}
$quizitems = array('Question' => $data['inputQuestion'], 'Choices' => $stringChoices, 'Correct' => $data['correctanswer'], 'NumSequence' => $data['questionnumber']);
$quizitemid = $this->Teacher_model->insertQuizItemOnQuizItems($quizitems);
if (count($quizitemid) == 1)
{
$quizdeedid = $this->Teacher_model->getQuizDeedId($quiztitle);
$quizdatasetitem = array('QuizSet' => $data['quizsetnumber'], 'QuizItemID' => $quizitemid, 'QuizDeedID' => $quizdeedid);
$quizdatasetid = $this->Teacher_model->insertQuizOnQuizDataSet($quizdatasetitem);
if(count($quizdatasetid) == 1)
{
$response = array(
'status' => "success"
);
echo json_encode($response);
}
}
}
and this is my quiz form, in quizView.php
<div class="container-fluid container-cards-pf container-pf-nav-pf-vertical
nav-pf-persistent-secondary">
<div class="row row-cards-pf">
<!-- Important: if you need to nest additional .row within a .row.row-cards-pf, do *not* use .row-cards-pf on the nested .row -->
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="card-pf">
<div class="card-pf-heading">
<h1 align="center">
<strong><?php echo str_replace("%20", " ", $quizTitle); ?></strong>
</h1>
<h2 class="card-pf-title" align="center">
<label><?php echo str_replace("%20", " ", $quizDescription); ?></label>
</h2>
</div>
<div class="card-pf-body" id="divquizset" style="height: 50px">
<div class="col-sm-2">
</div>
<div class="col-sm-9" id="divquizset">
<div class="col-sm-3">
<p align="right"> QUIZ SET: </p>
</div>
<div class="col-sm-4">
<input align="center" type="text" id="quizset" class="form-control"></input>
</div>
<button class="btn btn-default col-sm-2" align="left" onclick="saveQuizSet()">Save</button>
</div>
<div class="col-sm-1">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="container">
<div class="col-sm-12">
<div id="status">
</div>
</div>
</div>
</div>
<div class="container-fluid container-cards-pf container-pf-nav-pf-vertical
nav-pf-persistent-secondary" id="list1" style="padding-top: 0px">
<!-- LIST VIEW PART 1 -->
<div id = "div1" style="padding-top: 0px">
<?php echo form_open("Teacher/insert_quiz/$quizTitle/$quizDescription", "id='myForm'", $hidden= array()); ?>
<div>
<div class="list-group list-view-pf list-view-pf-view">
<div class="list-group-item">
<div class="list-group-item-header" id="div2">
<div class="list-view-pf-expand">
<span class="fa fa-angle-right"></span>
</div>
<div class="list-view-pf-checkbox">
<input type="text" name="questionnumber" id="inputquestionnumber1" class="form-control">
<!-- <b id="questionnumber" name="questionlabel" for="inputQuestion">Question 1: </b> -->
<input type="hidden" name="quizsetnumber" id="quizsetnum" class="form-control" value="">
</div>
<div class="list-view-pf-actions">
<?php echo form_submit('submit', 'Save', $attributes=array("class" => "btn btn-default")); ?>
<!-- <button class="btn btn-default" style="width: 100px">Save</button> -->
<button class="btn btn-default" style="width: 100px">Edit</button>
<button class="btn btn-default" style="width: 100px">Delete</button>
</div>
<div class="list-view-pf-main-info">
<div class="list-view-pf-body">
<div class="list-view-pf-description">
<div class="list-group-item-text form-group">
<input type="text" name="inputQuestion" id="input1" class="form-control">
</div>
</div>
</div>
</div>
</div>
<div class="list-group-item-container container-fluid hidden" id="containerDiv">
<div class="close">
<span class="pficon pficon-close"></span>
</div>
<div class="row">
<!-- LIST VIEW SUB VIEW -->
<div class="col-md-12">
<form class="form-horizontal" style="padding-left: 100px">
<div class="form-group">
<div class="col-sm-7" align="center">
<dt> CHOICES </dt>
</div>
<div class="col-sm-5" align="center">
<dt> CORRECT ANSWER </dt>
</div>
<div class="col-sm-7">
<div id="divCorrect" style="padding-top: 10px">
<input type="text" name="correctanswer" id="inputcorrectanswer1" class="form-control">
</div>
</div>
<div class="col-sm-5" id="divChoiceContainer1">
<div id="divChoice" style="padding-top: 10px">
<input type="text" name="inputChoice1" id="inpChoice1" class="form-control">
</div>
</div>
<div class="col-sm-7" id="otherDivChoiceContainer1">
</div>
<div class="col-sm-7" align="center" style="padding-top: 20px">
<button type="button" class="btn btn-primary btn-lg btn-block col-xs-9" id = "1" align="center" onclick="addChoiceFunction(this.id)" >Add Choices</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?= form_close() ?>
</form>
</div>
</div>
</div>
<div class="col-sm-3 container-fluid container-cards-pf container-pf-nav-pf-vertical nav-pf-persistent-secondary">
<button type="button" class="btn btn-primary btn-lg btn-block col-md-9" align="center" onclick="addQuestionFunction()">Add Question</button>
</div>
These are the scripts I used, they're also in the quizView.php:
<script>
jQuery(document).ready(function($) {
$('#myForm').ajaxForm({
beforeSubmit: function(formData, jqForm, options){
$("div#status").html('');
},
success: function(response){
var result = $.parseJSON(response);
$("div#status").html('<div class="alert alert-' + result.status + '" role="alert"> HI </div>');
}
});
});
</script>
<script>
$(document).ready(function () {
// click the list-view heading then expand a row
$(".list-group-item-header").click(function(event){
if(!$(event.target).is("button, a, input, .fa-ellipsis-v")){
$(this).find(".fa-angle-right").toggleClass("fa-angle-down")
.end().parent().toggleClass("list-view-pf-expand-active")
.find(".list-group-item-container").toggleClass("hidden");
} else {
}
})
// click the close button, hide the expand row and remove the active status
$(".list-group-item-container .close").on("click", function (){
$(this).parent().addClass("hidden")
.parent().removeClass("list-view-pf-expand-active")
.find(".fa-angle-right").removeClass("fa-angle-down");
})
});
</script>
<script>
function addQuestionFunction() {
$num = $('div .list-view-pf-view').length + 1;
$divId = "#" + $num;
$toClone = $('#div1').clone(true).find("input").val("").end();
$($toClone).find("#containerDiv").addClass("hidden").end();
$($toClone).find("#otherDivChoiceContainer1").attr("id", "otherDivChoiceContainer"+ $num);
$($toClone).find("#otherDivChoiceContainer" + $num).find("#divChoice").remove().end();
$($toClone).find("#1").attr("id", $num);
$($toClone).find("#questionnumber").text("Question " + $num + ": ");
if($($toClone).find("span").hasClass("fa-angle-down")) {
$($toClone).find(".fa-angle-right").removeClass("fa-angle-down").end();
}
$('#list1').append($toClone);
}
function addChoiceFunction(clicked_id) {
$num = parseInt(clicked_id);
$divId = "#otherDivChoiceContainer" + $num;
$numChoice = $($divId + " input").length + 2;
$toClone = $('#divChoice').clone(true).find("input").val("").end();
$toClone.find("#inpChoice1").attr("id", "inpChoice" + $numChoice).attr("name", "inputChoice" + $numChoice);
// $toClone.find("#inpChoice" + $num).attr("name", $("#inpChoice"+$num).attr("name").replace(/\\[\d+\\]/,"inputChoice" + $num));
//alert($numChoice);
$($divId).append($($toClone));
}
function saveQuizSet() {
$('#quizsetnum').val($('#quizset').val());
$quizsetval = $('#quizset').val();
$('#divquizset').empty();
$('#divquizset').append(' <p align="center"> QUIZ SET: '+ $quizsetval + '</p>');
// $('#divquizset').append(" <p align="center"> QUIZ SET: A </p>");
}
</script>
And for my script sources I used these:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://malsup.github.io/jquery.form.js"></script>
<script src="http://www.patternfly.org/components/jquery/dist/jquery.min.js"></script>
<script src="http://www.patternfly.org/components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="http://www.patternfly.org/components/patternfly-bootstrap-combobox/js/bootstrap-combobox.js"></script>
<script src="http://www.patternfly.org/components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>
<script src="http://www.patternfly.org/components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script src="http://www.patternfly.org/components/d3/d3.min.js"></script>
<script src="http://www.patternfly.org/components/c3/c3.min.js"></script>
<script src="http://www.patternfly.org/components/datatables/media/js/jquery.dataTables.js"></script>
<script src="http://www.patternfly.org/components/google-code-prettify/bin/prettify.min.js"></script>
<script src="http://www.patternfly.org/components/clipboard/dist/clipboard.min.js"></script>
<script src="http://www.patternfly.org/components/patternfly/dist/js/patternfly.min.js"></script>
<script src="http://www.patternfly.org/components/jquery-match-height/dist/jquery.matchHeight-min.js"></script>
<script src="http://www.patternfly.org/assets/js/patternfly-site.min.js"></script>
<link rel="canonical" href="http://www.patternfly.org/pattern-library/navigation/vertical-navigation/vertical-navigation.html">
This is what my form looks like
quizviewform
And this is what it's returning
returnpage
It's inserting on my database, but it doesn't return on the page and ajax doesn't work. :( I hope someone can help me here. Thanks!

Laravel blade #extends doesn't work

I have strange issue in laravel blade everything works normally until I edit something in the file the master layout stop loading correctly for no reason
sometime the page html content load partially
It works fine on localhost but on the server
I stopped cloudflare and all caches
As I said the issue occurs only when I edit some file only that page stop working the other pages works normally unless I edit them or add something to them
I hope you can help me.
master file
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="csrf-token" content="{{ csrf_token() }}"/>
<link rel="icon" type="image/png" href="{{asset('../storage/app/public/Favicon_reviews.png')}}">
<title>
{{(is_array(($web_title ?? ''))? $web_title[1] ?? '': $web_title ?? '') ?? 'Home'}}
</title>
{{--foundation css--}}
<link rel="stylesheet" href="{{asset('css/foundation.css')}}">
<!-- Custom styles for this template -->
<link rel="stylesheet" href="{{asset('css/dashboard.css')}}">
<link rel="stylesheet" href="{{asset('css/style.css')}}">
<link rel="stylesheet" href="{{asset('css/dripicon.css')}}">
<link rel="stylesheet" href="{{asset('css/typicons.css')}}">
<link rel="stylesheet" href="{{asset('css/font-awesome.min.css')}}">
<link rel="stylesheet" href="{{asset('css/theme.css')}}">
<link rel="stylesheet" href="{{asset('css/jquery.toastmessage.css')}}">
<link rel="stylesheet" href="{{asset('js/circle-progress/jquery.circliful.css')}}">
<!-- pace loader -->
{{--for top blue line loader--}}
<script src="{{asset('js/pace/pace.js')}}"></script>
<link rel="stylesheet" href="{{asset('js/pace/themes/green/pace-theme-flash.css')}}">
{{--<link rel="stylesheet" href="{{asset('js/pace/themes/templates/pace-theme-barber-shop.tmpl.css')}}">--}}
{{-- <link rel="stylesheet" href="{{asset('js/pace/themes/green/pace-theme-big-counter.css')}}">--}}
{{--end pace--}}
<link rel="stylesheet" href="{{asset('js/slicknav/slicknav.css')}}">
{{--to support effects in old broswer--}}
<script src="{{asset('js/vendor/modernizr.js')}}"></script>
<link rel="stylesheet" href="{{asset('css/main-style.css')}}">
{{--js scripts--}}
#yield('css')
</head>
<body>
<!-- preloader -->
<div id="preloader">
<div id="status"> </div>
</div>
<!-- End of preloader -->
<div class="off-canvas-wrap content" data-offcanvas>
<!-- right sidebar wrapper -->
<div class="inner-wrap">
<!-- Right sidemenu -->
<div id="skin-select">
<!-- Toggle sidemenu icon button -->
<a id="toggle">
<span class="fa icon-menu"></span>
</a>
<!-- End of Toggle sidemenu icon button -->
<div class="skin-part">
<div id="tree-wrap">
#include('main.left-nav')
</div>
</div>
</div>
<!-- end of Rightsidemenu -->
<div class="wrap-fluid" id="paper-bg">
<!-- top nav -->
<div class="top-bar-nest">
<nav class="top-bar" data-topbar role="navigation" data-options="is_hover: false">
#include('main.top-nav')
</nav>
</div>
<!-- end of top nav -->
<!-- breadcrumbs -->
<ul class="breadcrumbs ">
<li><a href="{{url('/')}}"><span style=" font-size: 15px; position: relative; top: -3px;"
class="fa fa-home"></span></a>
</li>
#if(is_array(($web_title ?? false)))
#foreach($web_title as $title)
<li>
{!! $title ?? '' !!}
</li>
#endforeach
#else
<li>
{{$web_title ?? ''}}
</li>
#endif
{{--<li>{{$web_title}}
</li>--}}
</ul>
<!-- end of breadcrumbs -->
<!-- Container Begin -->
<div class="row" style="margin-top:-20px">
#yield('container')
</div>
<!-- End of Container Begin -->
#include('main.footer')
</div>
<!-- Right Menu -->
<aside class="right-off-canvas-menu">
{{--#include('main.right-nav')--}}
</aside>
<!-- close the off-canvas menu -->
<a class="exit-off-canvas"></a>
<!-- End of Right Menu -->
</div>
<!-- end paper bg -->
</div>
<!-- end of off-canvas-wrap -->
<!-- end of inner-wrap -->
<!-- main javascript library -->
<script src="{{asset('/js/jquery.js')}}"></script>
<script src="{{asset('/js/waypoints.min.js')}}"></script>
<script src="{{asset('/js/preloader-script.js')}}"></script>
<!-- foundation javascript -->
<script src="{{asset('/js/foundation.min.js')}}"></script>
<script src="{{asset('/js/foundation/foundation.dropdown.js')}}"></script>
<!-- main edumix javascript -->
{{--add scroll bar to divs--}}
<script src="{{asset('/js/slimscroll/jquery.slimscroll.js')}}"></script>
{{--mobile menu--}}
<script src="{{asset('/js/slicknav/jquery.slicknav.js')}}"></script>
<script src="{{asset('/js/sliding-menu.js')}}"></script>
<script src="{{asset('/js/scriptbreaker-multiple-accordion-1.js')}}"></script>
<script src="{{asset('/js/number/jquery.counterup.min.js')}}"></script>
<script src="{{asset('/js/circle-progress/jquery.circliful.min.js')}}"></script>
<script src="{{asset('/js/jquery.toastmessage.js')}}"></script>
<script src="{{asset('/js/app.js')}}"></script>
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
</script>
<script type="text/javascript">
(function ($) {
"use strict";
})(jQuery);
</script>
<script>
$(document).foundation();
</script>
<script>
/*helper functions*/
function confirm(title, message, callback) {
// create your modal template
var modal = '<div class="reveal-modal tiny" id="confirmation" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog" data-animation-in="slide-in-down">' +
'<h2>' + title + '</h2>' +
'<p class="lead">' + message + '</p>' +
'<button class="button success yes" style="margin-right: 50px;">Yes</button>' +
'<button class="button alert float-right close-reveal" >No</button>' +
'</div>';
// appending new reveal modal to the page
$('body').append(modal);
// registergin this modal DOM as Foundation reveal
/* var confirmation = new Foundation.Reveal($('#confirmation'));
// open
confirmation.open();*/
var confirm_selector = $('#confirmation');
confirm_selector.foundation('reveal', 'open');
// listening for yes click
confirm_selector.children('.yes').on('click', function () {
// close and REMOVE FROM DOM to avoid multiple binding
confirm_selector.foundation('reveal', 'close');
confirm_selector.remove();
// calling the function to process
callback.call();
});
$(document).on('closed.zf.reveal', '#confirmation', function () {
// remove from dom when closed
confirm_selector.foundation('reveal', 'close');
});
}
$(document).on('click', '.close-reveal', function () {
$('#confirmation').foundation('reveal', 'close');
});
</script>
{{--header javascript--}}
{{--search process img--}}
<script>
$(document).ready(function () {
$('#search_form').submit(function (e) {
$('#search_loading').show();
});
});
</script>
<script>
$(document).ready(function () {
$('#contact_us_form').submit(function (event) {
event.preventDefault();
$('.message_button').prop('disabled', true);
$.ajax({
url: '{{url('/contact_us')}}',
type: 'POST',
data: $(this).serialize(),
success: function (data) {
// console.log(data);
$().toastmessage('showToast', {
text: data.success,
stayTime: 3000,
sticky: false,
position: 'top-center',
type: 'success',
closeText: '',
close: null
});
$('.message_button').prop('disabled', false);
$('#requests').foundation('reveal', 'close');
$("#contact_us_form")[0].reset();
}
});
})
});
</script>
{{--request form--}}
<script>
$(document).ready(function () {
$('#requests_form').submit(function (event) {
event.preventDefault();
$('.message_button').prop('disabled', true);
$.ajax({
url: '{{url('/contact_us')}}',
type: 'POST',
data: $(this).serialize(),
success: function (data) {
$().toastmessage('showToast', {
text: data.success,
stayTime: 3000,
sticky: false,
position: 'top-center',
type: 'success',
closeText: '',
close: null
});
$('.message_button').prop('disabled', false);
$('#requests').foundation('reveal', 'close');
$("#requests_form")[0].reset();
}
});
})
});
</script>
<script>
$('.input_option').change(function () {
if ($(this).val() == 'tag') {
$('.tag_messages').html('You can add more then one tag by adding comma Ex(tag1,tag2,.....)');
} else {
$('.tag_messages').html('');
}
});
</script>
<script>
var textarea = null;
window.addEventListener("load", function () {
textarea = window.document.querySelector("#contact_area");
textarea.addEventListener("keypress", function () {
if (textarea.scrollTop != 0) {
textarea.style.height = textarea.scrollHeight + "px";
}
}, false);
}, false);
</script>
<script>
var textarea = null;
window.addEventListener("load", function () {
textarea = window.document.querySelector("#contact_area1");
textarea.addEventListener("keypress", function () {
if (textarea.scrollTop != 0) {
textarea.style.height = textarea.scrollHeight + "px";
}
}, false);
}, false);
</script>
#yield('javascript')
</body>
</html>
Home page
#extends('main.master')
#section('container')
<div class="row" style="margin-top:-20px">
<div class="large-12 columns">
<blockquote style="border-right: 3px solid #8c92a3;text-align: center;margin-top: 5px;">
Thank you for installing the application, please take a moment of your time and rate the app. It will help us to improve the application for you.
<a>Rate Here</a>
</blockquote>
</div>
</div>
<div class="row" >
<div class="large-8 columns">
<div class="box bg-transparent ">
<!-- /.box-header -->
<div class="box-header no-pad bg-transparent">
<h3 style="margin-bottom:20px;" class="box-title">
<span>Daily Visitors</span>
</h3>
</div>
<div class="box-body no-pad">
<div id="line-chart" style="height: 235px; padding: 0px; position: relative;">
<canvas class="flot-base"
style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 785px; height: 235px;"
width="863" height="258"></canvas>
<div class="flot-text"
style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; font-size: smaller; color: rgb(84, 84, 84);">
<div class="flot-x-axis flot-x1-axis xAxis x1Axis"
style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;">
</div>
</div>
<canvas class="flot-overlay"
style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 785px; height: 235px;"
width="863" height="258"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="large-4 columns">
<div class="box bg-transparent ">
<!-- /.box-header -->
<div class="box-header no-pad bg-transparent">
<h3 style="margin:0 20px 0 -5px;" class="box-title">
<span>Visitors</span>
</h3>
</div>
<div style="margin:15px 0 0" class="box-body no-pad">
<div class="stats-wrap">
<h2><b class="counter-up" style="color:#666;">{{$counter_visitors_data[0]['year'] ?? 0 }}</b> <span
style="background:#666;">+<b
class="counter-up">{{($counter_visitors_data[0]['year_rating'] ?? 0) <= 100 ? ($counter_visitors_data[0]['year_rating']?? 0): 100 }}</b>%</span>
</h2>
<p class="text-grey">Total Visitors
<small>This Year vs last year</small>
</p>
<h4><b class="counter-up" style="color:#888;">{{$counter_visitors_data[1]['month'] ?? 0 }}</b> <span
style="background:#888;">+<b
class="counter-up">{{($counter_visitors_data[1]['month_rating'] ?? 0) <= 100 ? ($counter_visitors_data[0]['month_rating'] ?? 0):100}}</b>%</span>
</h4>
<p>New Visitors
<small>This Month</small>
</p>
<h4 style="color:#333;"><b class="counter-up">{{$counter_visitors_data[2]['week'] ?? 0 }}</b> <span
style="background:#333;">+<b
class="counter-up">{{($counter_visitors_data[2]['week_rating'] ?? 0) <= 100 ? ($counter_visitors_data[0]['week_rating']?? 0):100}}</b></span></h4>
<p>New Visitors
<small>This week</small>
</p>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
{{------------------------------------------section 2---------------------------------------}}
<div class="row" style="margin-top: 20px;">
<div class="large-4 columns">
<div class="box bg-transparent ">
<!-- /.box-header -->
<div class="box-header no-pad bg-transparent">
<h3 style="margin:0 20px 0 -5px;" class="box-title">
<span>Reviews</span>
</h3>
</div>
<div style="margin:15px 0 0" class="box-body no-pad">
<div class="stats-wrap">
<h2><b class="counter-up" style="color:#666;">{{$counter_reviews_data[0]['year'] ?? 0 }}</b> <span
style="background:#666;">+<b
class="counter-up">{{($counter_reviews_data[0]['year_rating'] ?? 0) <= 100 ? ($counter_reviews_data[0]['year_rating']?? 0):100}}</b>%</span>
</h2>
<p class="text-grey">Total Reviews
<small>This Year vs last year</small>
</p>
<h4><b class="counter-up" style="color:#888;">{{$counter_reviews_data[1]['month']?? 0 }}</b> <span
style="background:#888;">+<b
class="counter-up">{{($counter_reviews_data[1]['month_rating'] ?? 0) <= 100 ? ($counter_reviews_data[1]['month_rating']?? 0):100}}</b>%</span>
</h4>
<p>New Reviews
<small>This Month</small>
</p>
<h4 style="color:#333;"><b class="counter-up">{{$counter_reviews_data[2]['week']?? 0 }}</b> <span
style="background:#333;">+<b
class="counter-up">{{($counter_reviews_data[2]['week_rating'] ?? 0) <= 100 ? ($counter_reviews_data[2]['week_rating']?? 0):100 }}</b>%</span></h4>
<p>New Reviews
<small>This week</small>
</p>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<div class="large-4 columns">
<div class="bg-complete-profile">
<span class="bg-green fa fa-star"></span>
<!-- <img src="img/bag.png"> -->
<h6 class="bg-black text-white"><strong><a href="https://apps.shopify.com/aliexpress-reviews-2"
style="color: #ffffff;">Rate Application</a></strong></h6>
</div>
</div>
<div class="large-4 columns">
<div class="bg-complete-profile">
<span class="bg-green fontello-doc-1"></span>
<!-- <img src="img/box.png"> -->
<h6 class="bg-black text-white">FAQ</h6>
</div>
</div>
<div class="large-4 columns">
<div class="bg-complete-profile">
<span class="bg-green icon-user-group"></span>
<!-- <i class="img/count.png"></i> -->
<h6 class="bg-black text-white"><a href="{{url('visitors')}}" style="color: #ffffff;">Latest
Visitors</a></h6>
</div>
</div>
<div class="large-4 columns">
<div class="bg-complete-profile">
<span class="bg-green fontello-params"></span>
<!-- <i class="img/count.png"></i> -->
<h6 class="bg-black text-white"><a href="{{url('General_options')}}" style="color: #ffffff;">Main
Setting</a></h6>
</div>
</div>
</div>
{{------------------------------------------section 3---------------------------------------}}
<div class="large-12 columns">
<div class="box">
<div class="box-header bg-transparent">
<!-- tools box -->
<div class="pull-right box-tools">
<span class="box-btn" data-widget="collapse"><i class="icon-minus"></i>
</span>
<span class="box-btn" data-widget="remove"><i class="icon-cross"></i>
</span>
</div>
<h3 class="box-title"><i class=" icon-calendar"></i>
<span>Latest Visitor</span>
</h3>
</div>
<!-- /.box-header -->
<div class="box-body" style="display: block;">
<style>
#media screen and (max-width: 1400px) {
.visitors_images {
left: 60% !important;
}
}
#media screen and (max-width: 1000px) {
.visitors_images {
left: 50% !important;
top: 43px !important;
}
}
#media screen and (max-width: 700px) {
.visitors_images {
left: 65% !important;
top: 43px !important;
}
}
</style>
<div class="row">
<?php $counter = 0; ?>
#foreach($visitors as $visitor)
<?php
$product_id = $visitor['product_id'];
$country_code = $visitor['country_code'];
?>
<div class="large-4 medium-6 small-12 columns" style="float: left !important;">
<div class="school-timetable">
<hr>
<h5><span style="background: #92CD18;">New</span><strong> Visitor </strong>For
Product:<i><a
href="{{url("comments/$product_id/$shop")}}"
target="_blank">
{{str_limit(($visitor['product']['products'][0]['title'] ?? 'No Title'),17) }}
</a></i></h5>
<h6><i class=" fontello-home-outline"></i> From <span
style="background: transparent;"><img style="margin-bottom: 5px;"
src="{{url("images/flags").'/'.strtolower($country_code).'.png' ?? ''}}"></span>
</h6>
<h6 style="margin-bottom: 20px;"><i
class=" fontello-clock"></i>{{date('D, F y',strtotime($visitor['created_at'] ?? ''))}}
y
<span
class="bg-black">{{date('g a',strtotime($visitor['created_at'] ?? ''))}}</span>
</h6>
<div class="visitors_images" style=" position: absolute;
left: 56%;
top: 43px;">
<img width="50px"
src="{{$visitor['product']['products'][0]['images'][0]['src'] ?? URL::asset('../storage/app/public/NoPicAvailable.png')}}">
</div>
</div>
</div>
<?php $counter ++; ?>
#endforeach
</div>
</div>
<!-- /.box-body -->
</div>
</div>
#endsection
#section('javascript')
<script src="{{URL::to('/js/flot/jquery.flot.js')}}"></script>
<!-- FLOT RESIZE PLUGIN - allows the chart to redraw when the window is resized -->
<script src="{{URL::to('/js/flot/jquery.flot.resize.min.js')}}"></script>
<!-- FLOT PIE PLUGIN - also used to draw donut charts -->
<script src="{{URL::to('/js/flot/jquery.flot.pie.min.js')}}"></script>
<!-- FLOT CATEGORIES PLUGIN - Used to draw bar charts -->
<script src="{{URL::to('/js/flot/jquery.flot.categories.min.js')}}"></script>
<script type="text/javascript">
<?php $counter_days = 1;?>
var ticks = [
#foreach($numbers_of_visitors_last_10_days as $keys=>$dates )
#if($counter_days <=1)
[{{ltrim($keys,'0')}}, "days {{ltrim($keys,'0')}}"],
#else
[{{ltrim($keys,'0')}},{{ltrim($keys,'0')}}],
#endif
<?php $counter_days ++;?>
#endforeach
];
$(function () {
"use strict";
/*
* LINE CHART
* ----------
*/
var line_data2 = [
#foreach($numbers_of_visitors_last_10_days as $keys=>$dates )
[{{ltrim($keys,'0')}}, {{count($dates)}}],
#endforeach
];
var xaxisLabel = $("<div class='axisLabel xaxisLabel'></div>")
.text("My X Label")
.appendTo($('#line-chart'));
$.plot("#line-chart", [line_data2], {
grid: {
hoverable: true,
borderColor: "#E2E6EE",
borderWidth: 1,
tickColor: "#E2E6EE"
},
series: {
shadowSize: 2,
lines: {
show: true
},
points: {
show: true
}
},
colors: ["#333333", "#cccccc"],
lines: {
fill: true,
},
yaxis: {
show: true,
tickFormatter: function (val, axis) { return val }
},
xaxis: {
show: true,
ticks: ticks,
}
});
});
</script>
#endsection
I think it because of cached views. laravel make all the pages and save them in storage/framework/views directory.So that it won't have to make the pages from scratch in every request. And make the loading faster.
type this on cmd after editing the files:
php artisan view:clear
Or you can delete them manually.
after that type this on cmd:
composer dump-autoload
Then laravel has to make the pages and save them again.
Hope it would help!

Categories