How to add a jquery input slider or toggle switch - php

I am trying to add a toggle switch to allow the data to update to either yes or no on the table without actually clicking on the edit button. I am not sure how to go about this. I need it on the $e->Complete section. If it cant't be done in the admin_view then I will settle it in the edit_view page section but I need it so when they click on the yes or no that it automatically updates the post.
Admin_View.php page
<link href="<?php echo base_url();?>assets/css/bootstrap.min.css" rel="stylesheet">
<?php
$msg = $this->session->flashdata('msg');
if ( (isset($msg)) && (!empty($msg)) ) {
?>
<div class="alert alert-warning" >
×
<?php print_r($msg); ?>
</div>
<?php
}
$msg = $this->session->flashdata('msg1');
if ( (isset($msg)) && (!empty($msg)) ) {
?>
<div class="alert alert-danger" >
×
<?php print_r($msg); ?>
</div>
<?php
}
?>
<script>
$(document).ready(function(){
$('#table').dataTable();
});
$(document).ready(function(){
$('#date').trigger('click');
});
</script>
<div class="row-fluid" >
<div class="span10" style="margin-left:100px">
<div class="widget">
<div class="widget-header">
<i class="icon-truck"></i>
<h3>Admin Callins Edit View</h3>
</div>
<div class="widget-content" align="center">
<table class="table table-bordered" id="table">
<thead>
<tr>
<th id="date" style="text-align:center; background-color:#4C9ED9; color: #fff;">Date Scheduled</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Employee Name</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Employee Number</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Date Time Reported</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Reason</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Scheduled_Area</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Contact</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Approval Name</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Complete</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Edit</th>
<th style="text-align:center; background-color:#4C9ED9; color: #fff;">Delete</th>
</tr>
</thead>
<tr>
<?php $i=1; foreach($callin as $e ):?>
<td style="text-align:center;"><?php echo $e->Date_Scheduled;?></td>
<td style="text-align:center;"><?php echo $e->Employee_Name;?></td>
<td style="text-align:center;"><?php echo $e->Employee_Number;?></td>
<td style="text-align:center;"><?php echo $e->Time_Reported;?></td>
<td style="text-align:center;"><?php echo $e->Reason;?></td>
<td style="text-align:center;"><?php echo $e->Scheduled_Area;?></td>
<td style="text-align:center;"><?php echo $e->Contact;?></td>
<td style="text-align:center;"><?php echo $e->Approval;?></td>
<td style="text-align:center;"><?php echo $e->Complete;?></td>
<td style="text-align:center;" >
Edit
</td>
<td style="text-align:center;">
<a class="btn btn-default" href="#del_<?php echo $e->id?>" data-toggle="modal">Delete</a>
</td>
</tr>
<?php endforeach ;?>
</table>
<!--Modal Start here-->
<?php foreach($callin as $d):?>
<div class="modal fade" id="del_<?php echo $d->id;?>" tabindex="-1" role="dialog" aria-labelledby="addModal" aria-hidden="true" >
<form action="<?php echo base_url();?>callin/delete_callin" method="post" data-parsley-validate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
<h4 class="modal-title" id="myAddLabel">Warning!</h4>
</div>
<div class="modal-body">
<div class="box-body">
<div align="center" class="alert alert-error">
<h4>Are You Sure to Delete this Details</h4>
</div><br>
</div><br><br>
<div align="center">
<input type="hidden" name="id" value="<?php echo $d->id;?>">
<button type="submit" class="btn btn-primary">Yes</button>
<button class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
</form>
</div>
<?php endforeach;?>
edit_view.php page
<DOCTYPE!>
<html>
<head>
<title>Edit Page</title>
<link href="<?php echo base_url();?>assets/css/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo base_url();?>assets/css/custom.css" rel="stylesheet">
</head>
<body>
<div class"col-lg-6">
<div class="alert alert-warning">
<br><br>
<h4>Edit Call-IN</h4>
<?php $msg = $this->session->flashdata('msg'); if((isset($msg)) && (!empty($msg))) { ?>
<div class="alert alert-success" >
×
<?php print_r($msg); ?>
</div>
<?php } ?>
<?php $msg = $this->session->flashdata('msg1'); if((isset($msg)) && (!empty($msg))) { ?>
<div class="alert alert-error" >
×
<?php print_r($msg); ?>
</div>
<?php } ?>
<form class="form-horizontal" action="<?php echo base_url();?>callin/update_callin" method="post">
<?php foreach($callin as $e):?>
<div class="pull-left">
<div class="form-group">
<label class="col-sm-5 control-label">Date Scheduled:</label>
<div class="btn btn-default" >
<input type="text" class="default" name="Date_Scheduled" value="<?php echo $e->Date_Scheduled;?>">
</div>
</div>
<div class="pull-left">
<div class="form-group">
<label class="col-sm-5 control-label">Employee Name:</label>
<div class="btn btn-default" >
<input type="text" class="default" name="Employee_Name" value="<?php echo $e->Employee_Name;?>">
</div>
</div>
<div class="pull-left">
<div class="form-group">
<label class="col-sm-5 control-label">Employee Number:</label>
<div class="btn btn-default" >
<input type="text" class="default" name="Employee_Number" value="<?php echo $e->Employee_Number;?>">
</div>
</div>
<div class="pull-left">
<div class="form-group">
<label class="col-sm-5 control-label"> Time Reported:</label>
<div class="btn btn-default" >
<input type="text" class="default" name="Time_Reported" value="<?php echo $e->Time_Reported;?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label"> Reason:</label>
<?php
$Reason = $e->Reason;
$options = array("Bereavement","Clinic","FMLA","ILL","ILL 2nd Day","Jury Duty",
"ILL/PTO","IOW","Late","Late???","Layoff","Leave Early",
"LeaveEarly FMLA","LeaveEarly ILL","LeaveEarly Personal","LeaveEarly FMLA","LNTB5H",
"MIA","NCI","NCIBOD","NCIFL","NCOFL","Other","Personal","SAC","STO","VLO");
?>
<div class="btn btn-default">
<select name="Reason" class="default">
<?php
// Define $Reason here or the 'selected' attribute will not work
foreach($options as $option){
if($Reason == $option){
echo "<option value='".$option."' selected='selected'>".$option."</option>";
}
else{
echo "<option value='".$option."'>".$option."</option>";
}
}
?>
</select>
</div>
</div>
<?php
$Scheduled_Area = $e->Scheduled_Area;
$options = array("CLAIMS","TELECOM","CLEAN", "FLAT","HG SORT ",
"HG TOTE","HANG 1","HANG 2", "INBOUND", "LP","MAINT","OUTBOUND",
"PEP","QA/II","RACK SHOES", "REGIONAL DELIVERY","IT");
?>
<div class="form-group">
<label class="col-sm-5 control-label">Scheduled Area:</label>
<div class="btn btn-default">
<select name="Scheduled_Area" class="default">
<?php
// Define $department here or the 'selected' attribute will not work
foreach($options as $option){
if($Scheduled_Area == $option){
echo "<option value='".$option."' selected='selected'>".$option."</option>";
}
else{
echo "<option value='".$option."'>".$option."</option>";
}
}
?>
</select>
</div>
</div>
<div class="pull-left">
<div class="form-group">
<label class="col-sm-5 control-label">Contact:</label>
<div class="btn btn-default" >
<input type="text" class="default" name="Contact" value="<?php echo $e->Contact;?>">
</div>
</div>
<div class="pull-left">
<div class="form-group">
<label class="col-sm-5 control-label">Approval Name: </label>
<div class="btn btn-default" >
<input type="text" class="default" name="Approval" value="<?php echo $e->Approval;?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">Complete:</label>
<?php
$Complete = $e->Complete;
$options = array("NO","Yes");
?>
<div class="btn btn-default">
<select name="Complete" class="default">
<?php
// Define $Complete here or the 'selected' attribute will not work
foreach($options as $option){
if($Complete == $option){
echo "<option value='".$option."' selected='selected'>".$option."</option>";
}
else{
echo "<option value='".$option."'>".$option."</option>";
}
}
?>
</select>
</div>
</div>
<br>
<div class="footer" align="center">
<input type="hidden" value="<?php echo $e->id;?>" name="id">
<input type="submit" value="Update" class="btn btn-default">
<!--<input type="reset" value="Cancel" class="btn btn-default"> not working for some reason-->
<button class= "btn btn-default" onclick="location.href='<?php echo base_url();?>callin/list_callins'">Cancel</button>
</div>
</div>
</div>
<?php endforeach;?>
</form>
</body>
</html>

I put this in the edit_view page
<div class="form-group">
<div class="switch_options">
<label class="col-sm-5 control-label">Complete: </label>
<span class="switch_enable"> Yes </span>
<span class="switch_disable"> NO </span>
<input type="hidden" class="default"value="<?php echo $e->Complete;?>">
<input type="hidden" name="Complete" class="switch_val" value=""/>
</div>
In replace of this:
<div class="form-group">
<label class="col-sm-5 control-label">Complete:</label>
<?php
$Complete = $e->Complete;
$options = array("NO","Yes");
?>
<div class="btn btn-default">
<select name="Complete" class="default">
<?php
// Define $Complete here or the 'selected' attribute will not work
foreach($options as $option){
if($Complete == $option){
echo "<option value='".$option."' selected='selected'>".$option."</option>";
}
else{
echo "<option value='".$option."'>".$option."</option>";
}
}
?>
</select>
</div>
</div>
<br>
My jQuery code is this:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.switch_options').each(function() {
//This object
var obj = jQuery(this);
var enb = obj.children('.switch_enable'); //cache first element, this is equal to Yes
var dsb = obj.children('.switch_disable'); //cache first element, this is equal to NO
var input = obj.children('input'); //cache the element where we must set the value
var input_val = obj.children('input').val(); //cache the element where we must set the value
/* Check selected */
if( 'NO' == input_val ){
dsb.addClass('selected');
}
else if( 'Yes' == input_val ){
enb.addClass('selected');
}
//Action on user's click(Yes)
enb.on('click', function(){
$(dsb).removeClass('selected'); //remove "selected" from other elements in this object class(NO)
$(this).addClass('selected'); //add "selected" to the element which was just clicked in this object class(Yes)
$(input).val('Yes').change(); //Finally change the value to Yes
});
//Action on user's click(NO)
dsb.on('click', function(){
$(enb).removeClass('selected'); //remove "selected" from other elements in this object class(Yes)
$(this).addClass('selected'); //add "selected" to the element which was just clicked in this object class(NO)
$(input).val('NO').change(); // //Finally change the value to NO
});
});
});
</script>
my CSS code is this:
<style type="text/css">
/* Main block */
.switch_options{
display: block;
font-family: "Helvetica", Arial, Sans-serif;
margin-bottom: 10px;
}
/* Main block clearfix */
.switch_options:before,
.switch_options:after{
content:'.';
display:block;
overflow:hidden;
visibility:hidden;
font-size:0;
line-height:0;
width:0;
height:0;
}
.switch_options:after{clear:both;}
/*Options*/
.switch_options span{
display: inline-block;
float: left;
padding: 4px 9px;
margin: 0;
cursor: pointer;
font-size: 12px;
font-weight: 700;
color: #555;
border: 1px solid #aaa;
text-transform: uppercase;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
}
.switch_options span:first-of-type{
border-radius: 2px 0 0 2px;
border-right: 0;
}
.switch_options span:last-of-type{
border-radius: 0 2px 2px 0;
border-left: 0;
}
.switch_options span:hover{
background: #fafafa;
}
/* Active option */
.switch_options span.selected{
background: #00b7ea; /* Old browsers */
background: -moz-linear-gradient(top, #00b7ea 0%, #009ec3 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00b7ea), color-stop(100%,#009ec3)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* IE10+ */
background: linear-gradient(to bottom, #00b7ea 0%,#009ec3 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 ); /* IE6-9 */
border-color: #0082A3;
color: #fff;
}
</style>

The first problem I see is on Admin_View.php, your table has some errors. you need to start the foreach loop before the <tr> tag. I would also try to place this inside <tbody> tags.
You have this:
<tr>
<?php $i=1; foreach($callin as $e ):?>
<td>..</td>
<!-- more tds -->
<td>..</td>
</tr>
<?php endforeach ;?>
Change it to this:
<tbody>
<?php $i=1; foreach($callin as $e ):?>
<tr>
<td>..</td>
<!-- more tds -->
<td>..</td>
</tr>
<?php endforeach ;?>
</tbody>

Related

Updating selected row using codeigniter?

I am trying to update specific row in tables using button tag .But it is updating last inserted row only and not the selected button tag.
Model
public function title_d($data,$title_id)
{
$this->db->where('title_id',$title_id);
$this->db->update('experience',$data);
}
view
<form method="POST" action="http://localhost/portfolio/user/title">
<?php
foreach($experience->result() as $values1) {
?>
<section class="row">
<section class="border mt-5 m-auto p-5" style="background: #fff; width: 30%; height: 250px;">
<input type="text" value="<?php echo $values1->title_id;?>" name="title_id" hidden />
<h5>Title</h5>
<input type="text" value="<?php echo $values1->title;?>" class="form-control place" name="title" style="width: 200px; height: 30px; border: 1px solid;">
</section>
<section class="border mt-5 m-auto p-4" style="background: #fff; width: 23%;height: 250px;">
<h5>Write What you know</h5>
<textarea style=" height: 150px; width: 180px;" name="write">
<?php echo $values1->write;?>
</textarea>
</section>
<section class="border mt-5 m-auto p-5" style="background: #fff; width: 25%; height: 250px; ">
<h5>update your details</h5>
<button type="submit" value="<?php echo $values1->title_id; ?>" style="background:#1C8ACA; height: 40px; " class="btn btn-primary">Update<?php echo $values1->title_id; ?></button>
<button type="submit" value="<?php echo $values1->title_id; ?>"style="background:#ff0000; height: 40px; " class="btn btn-danger">Delete<?php echo $values1->title_id;?></button>
</section>
</section>
<?php
}
?>
</form>
controller:
Class User extends CI_Controller {
public function index()
{
$this->load->model('User_model');
$user_id = 1;
$data['admin'] = $this->User_model->admin_data($user_id);
$data['images'] = $this->User_model->get_images($user_id);
$data['names'] = $this->User_model->get_name();
$data['intro'] = $this->User_model->get_intro();
$data['experience'] = $this->User_model->get_title();
$data['contact'] = $this->User_model->get_contact();
$this->load->helper('url');
$this->load->view('Home',$data);
}
public function title()
{
$this->load->model('User_model');
$title_id = $this->input->post('title_id');
$title = $this->input->post('title');
$write = $this->input->post('write');
$data = array("title"=>$title,"write"=>$write);
$this->User_model->title_d($data,$title_id);
$this->User_model->delete_title($title_id,$data);
redirect('/');
}
}
I think you have to create your loop with the form inside, like:
<?php foreach($experience->result() as $values1) { ?>
<form method="POST" action="http://localhost/portfolio/user/title">
<section class="row">
<section class="border mt-5 m-auto p-5" style="background: #fff; width: 30%; height: 250px;">
<input type="text" value="<?php echo $values1->title_id;?>" name="title_id" hidden />
<h5>Title</h5>
<input type="text" value="<?php echo $values1->title;?>" class="form-control place" name="title" style="width: 200px; height: 30px; border: 1px solid;">
</section>
<section class="border mt-5 m-auto p-4" style="background: #fff; width: 23%;height: 250px;">
<h5>Write What you know</h5>
<textarea style=" height: 150px; width: 180px;" name="write">
<?php echo $values1->write;?>
</textarea>
</section>
<section class="border mt-5 m-auto p-5" style="background: #fff; width: 25%; height: 250px; ">
<h5>update your details</h5>
<button type="submit" value="<?php echo $values1->title_id; ?>" style="background:#1C8ACA; height: 40px; " class="btn btn-primary">Update<?php echo $values1->title_id; ?></button>
<button type="submit" value="<?php echo $values1->title_id; ?>"style="background:#ff0000; height: 40px; " class="btn btn-danger">Delete<?php echo $values1->title_id;?></button>
</section>
</section>
</form>
<?php } ?>

content flows when the bootstrap alert message appear

I am across a little bit confusing problem. I want to display an alert message on the top of the screen when the account is activated. but problem is that when messages shows, the welcome blue box moves down which I don't want. When I close the alert message the content comes in their real position.
This is the html code
<!DOCTYPE html>
<html>
<head>
<?php include_once('head.php'); ?>
<title>Sign Up</title>
</head>
<body>
<?php
if(isset($_SESSION['act'])) ?>
<div class="text-center alert alert-primary alert-dismissible fade show" role="alert">
<?php echo $_SESSION['act']; ?>
<button type="button" class="close" data-dismiss="alert" aria-label="close">
×
</button>
</div> <?php
?>
<div class="container-fluid">
<div class="row">
<div class="col-md-7">
<div class="message-container">
<div class="message-inner-box">
<div class="title-container clearfix">
<p class="heading"> Welcome back, </p>
<p class="subheading"> Log In!</p>
</div>
</div>
</div>
<div class="image-header">
<img src="../image/sign up.png" alt="file not found" class="signUp-image">
</div>
</div>
<div class="col-md-5">
<div class="signuUp-header">
<div class="signUp-inner">
<form>
<div class="form-header">
<input type="text" class="input-field" placeholder="Enter Email">
</div>
<div class="form-header">
<div class="input-group">
<input type="password" id="password" class="input-field" placeholder="Password" />
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-lock" id="passwordSeen"> </i></span>
</div>
</div>
</div>
<div class="form-header">
<div class="forgetPassword text-right">
forget Password
</div>
</div>
<div class="form-header rememberMe">
<input type="checkbox" class="" />
<label class="form-check-label"> Remember me </label>
</div>
<div class="form-header">
<input type="submit" class="signUpButton" name="submit"/>
</div>
</form>
<div class="signUpFooter text-center">
<span> I'm a new member Sign Up</span>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../javascript/app.js"> </script>
</body>
</html>
This is the css code
/*Message box*/
.message-inner-box{
height: 300px;
width: 300px;
border-radius: 50%;
margin-top: -3.2em;
margin-left: -5em;
background-color: var(--message-box-color);
display: flex;
justify-content: center;
align-items: center;
}
.title-container {
margin-top: 50px;
color: var(--message-color);
}
.title-container p {
margin: 0;
}
.heading {
font-size: 1.3em;
font-weight: 600;
}
.subheading {
font-size: 2em;
font-weight: 800;
}
/*Sign Up page*/
.signUp-image {
height: 60%;
width: 60%;
}
.signuUp-header {
padding-top: 5rem;
}
.form-header {
margin-bottom: 2.5em;
}
.input-field {
height: 3em;
width: 80%;
padding: .3rem 2rem;
font-size: 14px;
font-weight: 700;
border: 1px solid var(--input-field-color);
border-radius: 5px;
}
You can add the style property to the alert div to include a negative bottom margin that repositions the element under this alert box.
<div style="margin-bottom: -50px" class="text-center alert alert-primary alert-dismissible fade show" role="alert">

How to save an image to a database?

I want the user to choose one image from the predefined set of icons and then the image will be saved in the database after submitting the form. (I also want to know what is the best data type I'll be using in saving it in the database).
I want to do it this way cause I don't want the user to upload images.
Also, I'm still new to php and jQuery so I kind of needed help in that too...
CODE:
/*add new task button*/
.add-btn-dark
{
color:black;
/*float:right;*/
display:inline-block;
vertical-align:middle;
border:1px solid black;
margin-right:0;
}
.add-btn-dark i, .add-btn-dark span
{
display:inline-block;
vertical-align:middle;
}
.add-btn-dark:hover
{
cursor:pointer !important;
color:white;
background-color:black;
}
.add-btn-dark:focus
{
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
/*Icon Set*/
.iconSet
{
margin-left:2%;
display: inline-block;
vertical-align: middle;
border:1px solid black;
padding:5px;
width:60%;
}
.iconSet img
{
padding:5px;
margin-left:5px;
margin-right:5px;
display:inline-block;
vertical-align: middle;
}
.iconSet img:hover
{
cursor:pointer !important;
/*padding:5px;*/
border:0.5px solid black;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
<html>
<head>
<title>Sample Task Page</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <!-- Change these to the lastest -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style type="text/css">
/*add new task button*/
.add-btn-dark
{
color:black;
/*float:right;*/
display:inline-block;
vertical-align:middle;
border:1px solid black;
margin-right:0;
}
.add-btn-dark i, .add-btn-dark span
{
display:inline-block;
vertical-align:middle;
}
.add-btn-dark:hover
{
cursor:pointer !important;
color:white;
background-color:black;
}
.add-btn-dark:focus
{
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
/*Icon Set*/
.iconSet
{
margin-left:2%;
display: inline-block;
vertical-align: middle;
border:1px solid black;
padding:5px;
width:60%;
}
.iconSet img
{
padding:5px;
margin-left:5px;
margin-right:5px;
display:inline-block;
vertical-align: middle;
}
.iconSet img:hover
{
cursor:pointer !important;
/*padding:5px;*/
border:0.5px solid black;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
</style>
</head>
<body>
<button href="#" title="Add New Task" id="add" class="add-btn-dark btn" style="margin-left:45%;margin-top:10%;display: inline-block;vertical-align: middle;" data-toggle="modal" data-target="#addNewTaskModal"><i class="material-icons icon_dark" style="display: inline-block;vertical-align: middle;">assignment</i> Add New Task</button>
</body>
<!-- ADD NEW TASK Modal -->
<div id="addNewTaskModal" class="modal fade" style="margin-top:0%;">
<div class="modal-dialog modalcreateUser modal-xl">
<div class="modal-content">
<div class="modal-header">
<div class="avatar">
<img src="https://image.flaticon.com/icons/png/512/839/839986.png" style="width:25px;height:25px;display: inline-block;vertical-align: middle;" alt="Avatar">
</div>
<h4 class="modal-title" style="display: inline-block;vertical-align: middle;">Add New Task</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<h6 style="font-size:14px;color:red;margin-top:1%;text-align: center;margin-bottom:0;padding-bottom:0;">* required fields</h6>
<div id="">
<form method="post" class="needs-validation" novalidate>
<br>
<div class="form-group">
<div class="input-group" >
<label><small style="font-size:15px;color:red;">*</small> Task Name: <small>/ No more than 50 characters /</small></label>
<div class="input-group">
<input type="text" id="taskNameField" class="form-control" maxlength="50" name="" placeholder="e.g. Mop, Trash, Broom, etc." required>
</div>
</div>
<div class="invalid-feedback">
Empty field!
</div>
<small style="font-weight:normal;color:black;font-style: italic;float:right;"><span class="name-char-count" style="font-weight:bold;">50</span> characters remaining</small>
</div>
<div class="form-group">
<!-- <div class="" > -->
<label style="display: inline-block;vertical-align: middle;margin-right:2%;"><small style="font-size:15px;color:red;">*</small> Task Location:</label>
<!-- </div> -->
<!-- <div class="input-group">
<select class="custom-select" name="" id="" required>
<option value="">-Select One-</option>
<option value="MainTask">Main</option>
<option value="RooftopTask">Rooftop</option>
</select>
</div> -->
<div class="custom-control custom-radio custom-control-inline" style="display: inline-block;vertical-align: middle;margin-right:2%;">
<input class="custom-control-input" type="radio" name="taskLocation" id="inlineCheckbox1" value="option1" checked>
<label class="custom-control-label" for="inlineCheckbox1">Main</label>
</div>
<div class="custom-control custom-radio custom-control-inline" style="display: inline-block;vertical-align: middle;">
<input class="custom-control-input" type="radio" name="taskLocation" id="inlineCheckbox2" value="option2">
<label class="custom-control-label" for="inlineCheckbox2">Rooftop</label>
</div>
<div class="invalid-feedback">
Empty field!
</div>
</div>
<div class="form-group">
<label><small style="font-size:15px;color:red;">*</small> Task Description: <small>/ No more than 800 characters /</small></label>
<textarea class="form-control taskDescArea" name="" maxlength="800" placeholder="Enter detailed description here..." required></textarea>
<div class="invalid-feedback">
Empty field!
</div>
<small style="font-weight:normal;color:black;font-style: italic;float:right;"><span class="char-count" style="font-weight:bold;">800</span> characters remaining</small>
<!-- <div id="wct_embed_result"></div>
<div id="wct_powered_by"></div> -->
</div>
<div class="form-group">
<label style="display: inline-block;vertical-align: middle;"><small style="font-size:15px;color:red;">*</small> Task Icon:</label>
<!-- <input type="text" class="form-control" name="" placeholder="" required>
<div class="invalid-feedback">
Empty field!
</div> -->
<!-- <div class="iconSet" style="">
<img class="img-responsive" src="..\images\chore-icons\mop-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\toilet-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\pc-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\broom-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\trash-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\water-dispenser-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\air-conditioner-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\rag2-logo.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="..\images\chore-icons\sink-logo.png" style="color:#cc0000;height:50px;width:50px;">
</div> -->
<div class="iconSet" style="">
<!-- <select class="custom-select" name="emp-type" id="emp-type" required>
<option value="">-SelectOne-</option>
<option value="1"><img class="img-responsive" src="..\images\chore-icons\mop-logo.png" style="color:#cc0000;height:50px;width:50px;"></option>
<option value="2"><img class="img-responsive" src="..\images\chore-icons\toilet-logo.png" style="color:#cc0000;height:50px;width:50px;"></option>
<option value="3"><img class="img-responsive" src="..\images\chore-icons\pc-logo.png" style="color:#cc0000;height:50px;width:50px;"></option>
</select> -->
<!-- <input type="radio" id="broom" name="icon" value="broom"> <label for="broom"><img src="broom.png"></label> -->
<img class="img-responsive" src="https://image.flaticon.com/icons/png/512/79/79492.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="https://image.flaticon.com/icons/png/512/64/64022.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="https://image.flaticon.com/icons/png/512/1284/1284231.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="https://image.flaticon.com/icons/png/512/261/261277.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="https://image.flaticon.com/icons/png/512/1059/1059269.png" style="color:#cc0000;height:50px;width:50px;">
<img class="img-responsive" src="https://image.flaticon.com/icons/png/512/15/15222.png" style="color:#cc0000;height:50px;width:50px;">
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-lg btn-block add-btn-dark" name="">Add Task</button>
<button type="button" class="btn btn-lg btn-block add-btn-dark" data-dismiss="modal" >Cancel</button>
</div>
</form>
</div>
</div> <!-- end of modal body -->
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script>
// CHARACTER COUNT AND LIMIT TO TASK DESCRIPTION OR TEXT AREA
$(".taskDescArea").keyup(function(){
var maxLength = 800;
var length = $(this).val().length;
length = maxLength-length;
$(".char-count").text(length);
});
// CHARACTER COUNT AND LIMIT TO TASK NAME
$("#taskNameField").keyup(function(){
var maxLength = 50;
var length = $(this).val().length;
length = maxLength-length;
$(".name-char-count").text(length);
});
</script>
<!-- END OF ADD NEW TASK Modal -->
</html>
If it's a predefined list of icons, you probably want to store only a unique identifier of the selected icon - which could be a name or a number - as long as it allows you to display the correct image based on that identifier.
In your case, it looks like the filename could serve that purpose (eg. 'trash-icon' or 'sink-logo'). Or if you have an ordered list of all the icon filenames somewhere defined, you could also store the numeric index within that list.
by using base64_encode
$img = addslashes(base64_encode(file_get_contents('THE_IMAGE_PATH')));
save to database
INSERT INTO `table` (`emp_image`) VALUES ('$img'); //datatype => LONGTEXT
load the images from database:
$saved_img = $results['emp_image'];
<img src="data:image/jpeg;base64,<?=$saved_img;?>"/>
but the better way is to convert the images into icons from Icomoon
convert png to svg
load svg to icomoon
generate the fonts and ...

How can we add css in print preview?

code:
<style>
.center {
float: left;
text-align: center;
}
.center h3 {
color: #000;
font-weight: 600;
}
.left {
font-size: 14px;
float: left;
width: 30%;
color: #000;
}
.right {
font-size: 14px;
float: right;
width: 70%;
color: #000;
}
#bot {
margin-bottom: 2em;
}
#left {
font-size: 14px;
float: left;
width: 42%;
color: #000;
}
#right {
font-size: 14px;
float: right;
width: 58%;
color: #000;
}
table, td, th {
border: 1px solid #000;
text-align: left;
font-size: 14px;
font-weight: inherit;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 15px;
}
#pp {
font-size:14px;
color:#000;
}
.table-responsive {
overflow-x: hidden!important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
padding:0px!important;
}
</style>
<div class="col-md-12">
<a href="javascript:void(0)" class="btn btn-success" style="float: right;" onclick='printDiv();'>Print Sheet</a>
</div>
<div id="print_wrapp">
<div class="col-md-12" id="bot">
<div class="col-md-2">
<img src="<?php echo base_url(); ?>uploads/images/Lingayas Vidyapeeth Logo.png" class="img-responsive" style="width: 110px;">
</div>
<div class="col-md-10">
<div class="center">
<h3>
Lingaya's Vidyapeeth, Fraidabad<br>
Award Sheet<br>
End Semester Examination<br>
(May-June, 2019)
</h3>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="bot">
<div class="col-md-6">
<div class="left">
<p>Department: </p>
</div>
<div class="right">
<p><?php echo $award[0]['department_name']?></p>
</div>
<div class="left">
<p>Program/Course: </p>
</div>
<div class="right">
<p><?php echo $award[0]['classes']?></p>
</div>
<div class="left">
<p>Subject Name: </p>
</div>
<div class="right">
<p><?php echo $award[0]['subject']?></p>
</div>
<div class="left">
<p>Session: </p>
</div>
<div class="right">
<p><?php echo $award[0]['session']?></p>
</div>
</div>
<div class="col-md-6">
<div class="left">
<p>Semester: </p>
</div>
<div class="right">
<p><?php echo $award[0]['yearsOrSemester']?></p>
</div>
<div class="left">
<p>Subject Code: </p>
</div>
<div class="right">
<p><?php echo $award[0]['subject_code']?></p>
</div>
<div class="left">
<p>Maximum Marks: </p>
</div>
<div class="right">
<p></p>
</div>
</div>
</div>
<div class="col-md-12" id="bot">
<div class="col-md-12">
<div class="table-responsive">
<table id="example1" class="table table-striped table-bordered table-hover dataTable no-footer">
<thead>
<th>S.No.</th>
<th>Roll No.</th>
<th>Marks(In Figure)</th>
<th>Marks(in Words)</th>
</thead>
<tbody>
<?php
$i=1;
foreach($award as $row)
{
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row['roll']; ?></td>
<td></td>
<td></td>
</tr>
<?php
$i++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-12" id="bot">
<div class="col-md-6">
<div id="left">
<p>Total No. of Student Pass: </p>
</div>
<div id="right">
<p></p>
</div>
</div>
<div class="col-md-6">
<div id="left">
<p>Total No. of Student Fail: </p>
</div>
<div id="right">
<p></p>
</div>
</div>
</div>
</div>
</div>
<script>
function printDiv()
{
var divToPrint=document.getElementById('print_wrapp');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><link rel="stylesheet" href="<?php echo base_url(); ?>assets/plugins/bootstrap/css/bootstrap.css" type="text/css" /><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();
setTimeout(function(){newWin.close();},10);
}
</script>
In this code I am simply run print content inside div <div id="print_wrapp"> by click function i.e printDiv and its working properly but the problem is that print preview css not showing div content properly and an image is mention below:
and my original page look like:
So, How can I fix this problem? Please help me.
Thank You
You can apply the style sheet too both print and screen using media='screen,print'
<link ../bootstrap.min.css' rel='stylesheet' media='screen,print'>
or
<link ../bootstrap.min.css' rel='stylesheet' media='all'>
When we want to apply some style when printing a page, we need to apply the styles using #media print. Then only the style will apply for windows print function.
Style.css
#media print
{
.center {
float: left;
text-align: center;
}
.center h3 {
color: #000;
font-weight: 600;
}
.left {
font-size: 14px;
float: left;
width: 30%;
color: #000;
}
.right {
font-size: 14px;
float: right;
width: 70%;
color: #000;
}
}
Then link the css file where you want to print the page with style.
<link rel="stylesheet" type="text/css" href="Style.css">
Call the Print Function on Button Click
<button onclick="printPage()" class="center">Print</button>
<script>
function printPage()
{
print();
}
</script>

How to pass a php array as a post parameter in ajax call to a php file in the url

I want to pass a php array as a parameter to ajax call.I have done it with json_encode and JSON.parse . But I am ending up with a
Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse ()
This is for an php application developed with XAMPP Server.
**myfile.php**
This is the file where I have a view link.On clicking that link , I need to pass the array data to the post file in the ajax, where I will display the content inside the modal.
For that I have used the json_encode() and JSON.parse() , but I am ending up with this error.
<?php
$arrOne = array('test_arg_one' => 'Arg One','test_arg_two' => 'Arg Two','test_arg_three' => 'Arg Three');
$arrTwo = array('test_arg_one' => 'Arg One','test_arg_two' => 'Arg Two','test_arg_three' => 'Arg Three');
$arrThree = array('test_arg_one' => 'Arg One','test_arg_two' => 'Arg Two','test_arg_three' => 'Arg Three');
$json_one = json_encode($arrOne);
$json_two = json_encode($arrTwo);
$json_three = json_encode($arrThree);
?>
<html>
<form >
VIEW
</form>
<div id="MyModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog" style=" margin-top: -12%;">
<!-- Modal Content: begins -->
<div class="modal-content" style="width: 950px; margin-left: -190px;">
<div class="modal-header qutviewhead">
<h4 class="modal-title" style="text-align: center; margin-right: 305px;">Test</h4>
<!-- <button type="button" class="close qotviewclosebtn" data-dismiss="modal">×</button> -->
</div>
<!-- Modal Body -->
<div class="modal-body meadqrypopmdbody" style="height: 560px; overflow: scroll; overflow-x: hidden;">
<div class="header">
<img src="img1.jpg" style="width: 100%; height: 130px;">
</div>
<div style="display: flex; flex-wrap: wrap;">
<div style="width: 15%;">
<img src="img2.jpg" style="padding-top: 15px; width: 105px; height: 100%" align="left">
</div>
<div style="width: 85%;background: url('img3.jpg'); background-repeat: no-repeat; background-position: center; margin-top: 15px;">
<div id="div_one">
<div class="test-one">
</div>
</div>
</div>
</div>
<div style="margin-top: 15px; text-align: center;">
<p style="background: #2e3192; color: #fff; padding: 10px 10px;">Plot No.1148, West End Colony, Anna Nagar West Extension, Chennai-600 050. <br>
Ph : 044-26257357, 90421 33333. Email : abishek#senthilsafety.com, Web : www.ssspl.in
</p>
</div>
<div class="header">
<img src="img1.jpg" style="width: 100%; height: 130px;">
</div>
<div style="display: flex; flex-wrap: wrap;">
<div style="width: 15%;">
<img src="img2.jpg" style="padding-top: 15px; width: 105px; height: 100%" align="left">
</div>
<div style="width: 85%;background: url('img3.jpg'); background-repeat: no-repeat; background-position: center; margin-top: 15px;">
<div id="div_two">
<div class="test-two">
</div>
</div>
</div>
</div>
<div style="margin-top: 15px; text-align: center;">
<p style="background: #2e3192; color: #fff; padding: 10px 10px;">Plot No.1148, West End Colony, Anna Nagar West Extension, Chennai-600 050. <br>
Ph : 044-26257357, 90421 33333. Email : abishek#senthilsafety.com, Web : www.ssspl.in
</p>
</div>
<div class="header">
<img src="img1.jpg" style="width: 100%; height: 130px;">
</div>
<div style="display: flex; flex-wrap: wrap;">
<div style="width: 15%;">
<img src="img2.jpg" style="padding-top: 15px; width: 105px; height: 100%" align="left">
</div>
<div style="width: 85%;background: url('img3.jpg'); background-repeat: no-repeat; background-position: center; margin-top: 15px;">
<div id="div_three">
<div class="test-three">
</div>
</div>
</div>
</div>
<div style="margin-top: 15px; text-align: center;">
</div>
</div>
<div class="cusfooter">
<button type="button" class="btn btn-default modcanbtn" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</html>
$('.view_data').click(function(){
var record = $(this).attr("id");
var obj = JSON.parse('<?= $json_one; ?>');
var facArg1 = obj.arg1;
var facArg2 = obj.arg2;
var facArg3 = obj.arg3;
var obj1 = JSON.parse('<?= $json_two; ?>');
var facArg11 = obj1.arg1;
var facArg21 = obj1.arg2;
var facArg31 = obj1.arg3;
var obj2 = JSON.parse('<?= $json_three; ?>');
var facArg12 = obj2.arg1;
var facArg22 = obj2.arg2;
var facArg32 = obj2.arg3;
$.ajax({
url:"testCat.php",
method:"post",
data:{'id':record,'facArg1':facArg1,'facArg2':facArg2,'facArg3':facArg3,'facArg11':facArg11,'facArg21':facArg21,'facArg31':facArg31,'facArg12':facArg12,'facArg22':facArg22,'facArg32':facArg32},
success:function(data){
var divs = data.split('------');
$(".test-one").html(divs[0]);
$(".test-two").html(divs[1]);
$(".test-three").html(divs[2]);
$("#MyModal").modal("show");
}
});
})
**testCat.php** [file in the ajax call]
This the content getting displayed inside the modal.
if(isset($_POST['cert_id']))
{
$output_one = '<style>
.borderNone table,td,th{
border:none!important;
text-align:left !important;
padding:0px !important;
}
</style>
<div style="text-align:center;">
<section>
<table align="right">
<tr>
<th style="text-align: right;">Date: 20/09/2019</th>
</tr>
</table>
</section>
<section>
<div style="padding-top:35px;"></div>
<p><b><u>TEST FORM</u></b></p>
<p><b>SEC</b></p>
</section>
<br>
<section>
<table style="border:none;">';
$arrValues = array();
if(isset($_POST['facArg1']) && ($_POST['facArg1'] != '')){
$arrValues['arg_one'] = $_POST['facArg1'];
}
if(isset($_POST['facArg2']) && ($_POST['facArg2'] != '')){
$arrValues['arg_two'] = $_POST['facArg2'];
}
if(isset($_POST['facArg3']) && ($_POST['facArg3'] != '')){
$arrValues['arg_three'] = $_POST['facArg3'];
}
$i = 1;
foreach($arrValues as $key => $val){
$output_one .='<tr>
<td>'.$i.'.'.$key.'</td>
<td>'.$val.'</td>
</tr>';
$i++;
}
$i = count($arrValues) + 1;
foreach($pdfOne as $key => $val){
$output_one .= '<tr>
<td>'.$i.'.'.$key.'</td>
<td style="padding: 0px 0px 0px 40px !important;">'.$val.'</td>
</tr>';
$i++;
}
$output_one .= '</table>
</section></div>
<br>';
$output_two = '
<div style="text-align:center;"><section>
<table align="right">
<tr>
<th style="text-align: right;">Date: 20/09/2019</th>
</tr>
</table>
</section>
<section>
<div style="padding-top:35px;"></div>
<p><b><u>TEST 2</u></b></p>
</section>
<br>
<section>
<table style="border:none;">';
$arrValuesOne = array();
if(isset($_POST['facArg11']) && ($_POST['facArg11'] != '')){
$arrValuesOne['arg_one'] = $_POST['facArg11'];
}
if(isset($_POST['facVillage21']) && ($_POST['facVillage21'] != '')){
$arrValuesOne['arg_two'] = $_POST['facArg21'];
}
if(isset($_POST['facAdd31']) && ($_POST['facAdd31'] != '')){
$arrValuesOne['arg_three'] = $_POST['facArg31'];
}
$i = 1;
foreach($arrValuesOne as $key => $val){
$output_two .='<tr>
<td>'.$i.'.'.$key.'</td>
<td>'.$val.'</td>
</tr>';
$i++;
}
$i = count($arrValuesOne) + 1;
foreach($pdfTwo as $key => $val){
$output_two .= '<tr>
<td>'.$i.'.'.$key.'</td>
<td style="padding: 0px 0px 0px 40px !important;">'.$val.'</td>
</tr>';
$i++;
}
$output_two .= '</table>
</section></div>
<br>';
$output_three = '<style>
.borderNone table,td,th{
border:none!important;
text-align:left !important;
padding:0px !important;
}
</style>
<div style="text-align:center;"><section>
<table align="right">
<tr>
<th style="text-align: right;">Date:20/09/2019</th>
</tr>
</table>
</section>
<section>
<div style="padding-top:35px;"></div>
<p><b><u>TET</u></b></p>
</section>
<br>
<section>
<table style="border:none;">';
$arrValuesTwo = array();
if(isset($_POST['facName12']) && ($_POST['facName12'] != '')){
$arrValuesTwo['arg_one'] = $_POST['facName12'];
}
if(isset($_POST['facVillage22']) && ($_POST['facVillage22'] != '')){
$arrValuesTwo['arg_two'] = $_POST['facVillage22'];
}
if(isset($_POST['facAdd32']) && ($_POST['facAdd32'] != '')){
$arrValuesTwo['arg_three'] = $_POST['facAdd32'];
}
$i = 1;
foreach($arrValuesTwo as $key => $val){
$output_three .='<tr>
<td>'.$i.'.'.$key.'</td>
<td>'.$val.'</td>
</tr>';
$i++;
}
$i = count($arrValuesTwo) + 1;
foreach($pdfThree as $key => $val){
$output_three .= '<tr>
<td>'.$i.'.'.$key.'</td>
<td style="padding: 0px 0px 0px 40px !important;">'.$val.'</td>
</tr>';
$i++;
}
$output_three .= '</table>
</section></div>
<br>';
$output_two = '<div class="break-before"></div>'.$output_two;
$output_three = '<div class="break-before"></div>'.$output_three;
echo $output_one.'------'.$output_two.'------'.$output_three;
}
Kindly help me to solve this error.
Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at HTMLAnchorElement.<anonymous> (myfile.php:1093)
at HTMLAnchorElement.dispatch (jquery.3.2.1.min.js:3)
at HTMLAnchorElement.q.handle (jquery.3.2.1.min.js:3)
I want the array values to get displayed inside the modal.

Categories