Dear Team, Here is follow code of the view page and the below is the script code for the radio list. Please help me
<?php
use \koolreport\inputs\DateTimePicker;
use \koolreport\widgets\koolphp\Table;
use \koolreport\inputs\RadioList;
?>
<style>
.calendar.left .daterangepicker_input,
.calendar.right .daterangepicker_input {
display: none;
}
</style>
<div class="report-content">
<div class="text-center">
<h1>Not Visited List</h1>
<p class="lead">
</p>
</div>
<form method="post">
<div class="col-md-6 form-group" style="margin:auto 25%">
<?php
RadioList::create(array(
"name"=>"radioList",
"display"=>"horizontal",
//"dataStore"=>$this->dataStore("result"),
"data"=>array(
"CallingDate"=>"CallingDate",
"NextCallingDate"=>"NextCallingDate",
"LastCallingDate"=>"LastCallingDate",
),
));
?>
</div>
<div class="row" style="text-align:center;">
<div class="col-md-3 form-group" style="margin:auto 37%">
<strong>Select Date</strong>
<?php
DateTimePicker::create(array(
"name"=>"startDatePicker",
"maxDate"=>"@endDatePicker",
"format"=>"DD/MM/YYYY"
));
?>
</div>
</div>
<div class="form-group" style="margin-top:30px;text-align:center;">
<button class="btn btn-lg btn-primary" name="submit">Submit</button>
</div> <!--- value="Get Selected Values" -->
<!-- <pre><code><?php echo json_encode($this->params,JSON_PRETTY_PRINT) ?></code></pre> -->
</form>
<?php
if($this->dataStore("result")->countData()>0)
{
Table::create(array(
"dataStore"=>$this->dataStore("result"),
"cssClass"=>array(
"table"=>"table table-bordered"
),
"columns"=>array(
"custEnquiryId"=>array(
"label"=>"#EID",
),
"custName"=>array(
"label"=>"Patitent Name",
"formatValue"=>function($value,$row){
$custPhoneNumber = $row['custPhoneNumber'];
if($row)
{
return"<a href='EnquiryForm.php?id=$custPhoneNumber' style='color:blue;' target='_blanck'>$value</a>";
}
return $value;
}
),
"custPlace"=>array(
"label"=>"City",
),
//"custPhoneNumber"=>array(
// "label"=>"Number",
//),
"custServiceFor"=>array(
"label"=>"Treatment For",
),
"custAppointmentDateIND"=>array(
"label"=>"Appointment Date"
),
"custStatusDateIND"=>array(
"label"=>"CallBack Date"
),
"custAge"=>array(
"label"=>"Age"
),
"custVistId"=>array(
"label"=>"VisitID",
"formatValue"=>function($VisitID){
if($VisitID=='0')
{
return "null";
}
return $VisitID;
}
),
"custRemarks"=>array(
"label"=>"Remarks"
),
"callType"=>array(
"label"=>"CallType",
"formatValue"=>function($CallType){
if($CallType=='1')
{
return"Incoming Call";
}elseif($CallType=='2'){
return"Outgoing Call";
}elseif($CallType=='3'){
return"Walkin";
}
return $CallType;
}
),
"replyName"=>array(
"label"=>"Reply"
),
"statusName"=>array(
"label"=>"Status"
),
),
"paging"=>array(
"pageSize"=>10
),
));
}
else
{
?>
<!-- <div class="alert alert-warning">
<i class="glyphicon glyphicon-info-sign"></i> Sorry, we found no data
</div> -->
<?php
}
?>
<?php
/*
DataTables::create(array(
"dataSource"=>$this->dataStore("tblcustomerenquiries"),
"options"=>array(
"searching"=>true,
),
"searchOnEnter" => true,
"searchMode" => "or",
));*/
?>
</div>
<script>
<?php
if(isset($_POST['submit'])){
$selected_val = $_POST['radioList']; // Storing Selected Value In Variable
?>
//<script>
//alert('ddd');
//</script>
<?php
//echo "You have selected :".$selected_val; // Displaying Selected Value
if($selected_val=="CallingDate"){
echo '1';
echo
Table::create(array(
"dataSource"=>$this->src("cloudkli_demo")->$query=("SELECT ce.custEnquiryId,ce.custName,ce.custPlace,ce.custPhoneNumber,ce.custServiceFor,DATE_FORMAT(ce.custCreatedDate, '%d-%m-%Y') AS custCreatedDateIND,DATE_FORMAT(ce.custAppointmentDate, '%d-%m-%Y')As custAppointmentDateIND,
DATE_FORMAT(ce.custStatusDate, '%d-%m-%Y')As custStatusDateIND,ce.custAge,ce.custVistId,ce.custCustomerStatus,ce.custRemarks,ce.callType,cr.replyName,cs.statusName
FROM tblcustomerenquiries ce
LEFT JOIN tblcustomerreply cr ON ce.callType = cr.replyId
LEFT JOIN tblcustomerstatus cs ON ce.custCustomerStatus = cs.statusId
WHERE ce.custVistId IS null AND DATE_FORMAT(ce.custCreatedDate, '%d-%m-%Y')='12-03-2021'")
));
}
elseif($selected_val=="NextCallingDate"){
echo '2';
/*$query="SELECT ce.custEnquiryId,ce.custName,ce.custPlace,ce.custPhoneNumber,ce.custServiceFor,DATE_FORMAT(ce.custCreatedDate, '%d-%m-%Y') AS custCreatedDateIND,
DATE_FORMAT(ce.custCallBackDate, '%d-%m-%Y') AS custCallBackDateIND,DATE_FORMAT(ce.custAppointmentDate, '%d-%m-%Y')As custAppointmentDateIND,
DATE_FORMAT(ce.custStatusDate, '%d-%m-%Y')As custStatusDateIND,ce.custAge,ce.custVistId,ce.custCustomerStatus,ce.custRemarks,ce.callType,cr.replyName,cs.statusName
FROM tblcustomerenquiries ce
LEFT JOIN tblcustomerreply cr ON ce.callType = cr.replyId
LEFT JOIN tblcustomerstatus cs ON ce.custCustomerStatus = cs.statusId
WHERE ce.custVistId IS null AND DATE_FORMAT(ce.custCallBackDate, '%d-%m-%Y')='". $start ."'";*/
}
elseif($selected_val=="LastCallingDate"){
echo '3';
/*$query="SELECT ce.custEnquiryId,ce.custName,ce.custPlace,ce.custPhoneNumber,ce.custServiceFor,DATE_FORMAT(ce.custCreatedDate, '%d-%m-%Y') AS custCreatedDateIND,DATE_FORMAT(ce.custAppointmentDate, '%d-%m-%Y')As custAppointmentDateIND,
DATE_FORMAT(ce.custStatusDate, '%d-%m-%Y')As custStatusDateIND,ce.custAge,ce.custVistId,ce.custCustomerStatus,ce.custRemarks,ce.callType,cr.replyName,cs.statusName
FROM tblcustomerenquiries ce
LEFT JOIN tblcustomerreply cr ON ce.callType = cr.replyId
LEFT JOIN tblcustomerstatus cs ON ce.custCustomerStatus = cs.statusId
WHERE ce.custVistId IS null AND DATE_FORMAT(ce.custCreatedDate, '%d-%m-%Y')='". $start ."'";*/
}
}
?>
</script>