i am looking for sanding message every time a status is changed to respective customer id with predefined text.Like if product claimed then on click button message should reach via sms or whatsapp chosen,Looking in PHP script.Kindly ` Using here is what i treid.No clue how to do it any help to find out
[![enter image description here](https://i.stack.imgur.com/2u36N.jpg)](https://i.stack.imgur.com/2u36N.jpg)
<?php include 'db_connect.php' ?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12">
<button class="col-sm-3 float-right btn btn-primary btn-sm" type="button" id="new_laundry"><i class="fa fa-plus"></i> New Laundry</button>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<table class="table table-bordered" id="laundry-list">
<thead>
<tr>
<th class="text-center">Date</th>
<th class="text-center">Queue</th>
<th class="text-center">Customer Name</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$list = $conn->query("SELECT * FROM laundry_list order by status asc, id asc ");
while($row=$list->fetch_assoc()):
?>
<tr>
<td class=""><?php echo date("M d, Y h:m:s A",strtotime($row['date_created'])) ?></td>
<td class="text-right"><?php echo $row['queue'] ?></td>
<td class=""><?php echo ucwords($row['customer_name']) ?></td>
<?php if($row['status'] == 0): ?>
<td class="text-center"><span class="badge badge-secondary">Pending</span></td>
<?php elseif($row['status'] == 1): ?>
<td class="text-center"><span class="badge badge-primary">Processing</span></td>
<?php elseif($row['status'] == 2): ?>
<td class="text-center"><span class="badge badge-info">Ready to be Claim</span></td>
<?php elseif($row['status'] == 3): ?>
<td class="text-center"><span class="badge badge-success">Claimed</span></td>
<?php endif; ?>
<td class="text-center">
<button type="button" class="btn btn-outline-primary btn-sm edit_laundry" data-id="<?php echo $row['id'] ?>">Edit</button>
<button type="button" class="btn btn-outline-danger btn-sm delete_laundry" data-id="<?php echo $row['id'] ?>">Delete</button>
<button type="button" class="btn btn-outline-success btn-sm " data-id="<?php echo $row['id'] ?>">Whatsapp</button>
<button type="button" class="btn btn-outline-dark btn-sm " data-id="<?php echo $row['id'] ?>">SMS</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('#new_laundry').click(function(){
uni_modal('New Laundry','manage_laundry.php','mid-large')
})
$('.edit_laundry').click(function(){
uni_modal('Edit Laundry','manage_laundry.php?id='+$(this).attr('data-id'),'mid-large')
})
$('.delete_laundry').click(function(){
_conf("Are you sre to remove this data from list?","delete_laundry",[$(this).attr('data-id')])
})
$('#laundry-list').dataTable()
function delete_laundry($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_laundry',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)
}
}
})
}
</script>
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
JavaScript is a multi-paradigm language that supports event-driven, functional, and mandatory (including object-oriented and prototype-based) programming types. Originally JavaScript was only used on the client side. JavaScript is now still used as a server-side programming language. To summarize, we can say that JavaScript is the language of the Internet.
https://www.javascript.com/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.