mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
Added search function and frontend of add contacts
This commit is contained in:
@@ -23,15 +23,8 @@ class CompanyController extends Controller
|
|||||||
{
|
{
|
||||||
foreach ($matchedTerms as $key => $matchedTerm)
|
foreach ($matchedTerms as $key => $matchedTerm)
|
||||||
{
|
{
|
||||||
array_push($output,
|
array_push($output, ['company_name' => $matchedTerm->company_name, 'tel_no' => $matchedTerm->tel_no,
|
||||||
'<li style="display: show;">
|
'contact_person'=>$matchedTerm->contact_person ]);
|
||||||
<a href="#">
|
|
||||||
<i class="fa fa-user"></i>' . $matchedTerm->company_name .
|
|
||||||
'<span class="list-item-title-role" style="margin-top:-10px">' . $matchedTerm->tel_no . '</span>
|
|
||||||
<br>
|
|
||||||
<span class="list-item-title-role" style="margin-top:-10px">' . $matchedTerm->contact_person . '</span>
|
|
||||||
</a>
|
|
||||||
</li> <br>');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response($output);
|
return response($output);
|
||||||
|
|||||||
@@ -84,6 +84,45 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Wrapper Content End Here -->
|
<!-- Wrapper Content End Here -->
|
||||||
|
|
||||||
|
<div class="popup-overlay" id="formPopup5" style="display: none">
|
||||||
|
<!-- if you dont want overlay add class .no-overlay -->
|
||||||
|
<div class="popup-container">
|
||||||
|
<div class="popup-header">
|
||||||
|
<h3 class="popup-title" >Add a Contact</h3>
|
||||||
|
<span class="popup-close" data-dismiss="true"><i class="fa fa-times"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="popup-content">
|
||||||
|
|
||||||
|
<div class="form-row-group with-icons-no-padding">
|
||||||
|
<div class="form-row no-padding">
|
||||||
|
<div class="form-element-title">
|
||||||
|
<label style="color: #000">Company Name</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-divider"></div>
|
||||||
|
|
||||||
|
<div class="form-row no-padding">
|
||||||
|
<div class="form-element-title">
|
||||||
|
<label style="color: #000">Telephone number</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-divider"></div>
|
||||||
|
|
||||||
|
<div class="form-row no-padding">
|
||||||
|
<div class="form-element-title">
|
||||||
|
<label style="color: #000">Contact Person</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-divider"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="popup-footer">
|
||||||
|
<button class="button blue" id="addContact" data-dismiss="true">Add Contact</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- Required For All Pages, Otherwise Ugly Others Function Won't Work -->
|
<!-- Required For All Pages, Otherwise Ugly Others Function Won't Work -->
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||||
<script src="js/global.script.js"></script>
|
<script src="js/global.script.js"></script>
|
||||||
@@ -100,8 +139,9 @@
|
|||||||
data: {search: $('#search').val()},
|
data: {search: $('#search').val()},
|
||||||
|
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
console.log(data);
|
||||||
for(i=0; i<data.length; i++){
|
for(i=0; i<data.length; i++){
|
||||||
$('#AddCompany').append(data[i] + "<br/>");
|
$('#AddCompany').append('<li style="display: show;"> <a href="#" onclick="displayCompany()"> <i class="fa fa-user"></i>' + data[i].company_name + '<span class="list-item-title-role" style="margin-top:-10px">' + data[i].tel_no + '</span> <br> <span class="list-item-title-role" style="margin-top:-10px">'+ data[i].contact_person);
|
||||||
}
|
}
|
||||||
//$('#AddCompany').show();
|
//$('#AddCompany').show();
|
||||||
},
|
},
|
||||||
@@ -111,6 +151,11 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function displayCompany(){
|
||||||
|
$('#formPopup5').show();
|
||||||
|
|
||||||
|
}
|
||||||
// function CSearch() {
|
// function CSearch() {
|
||||||
// // Declare variables
|
// // Declare variables
|
||||||
// var input, filter, ul, li, a, i;
|
// var input, filter, ul, li, a, i;
|
||||||
|
|||||||
Reference in New Issue
Block a user