| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/application/views/scripts/supplier/ |
Upload File : |
<?php
$supplierListArr = $this->paginator;
$arrSupplierServices = $this->arrSupplierServices;
$SupplierTypeArrDB = $this->SupplierTypeArrDB;
if (is_array($SupplierTypeArrDB)) { $typesname = array();
foreach ($SupplierTypeArrDB as $SupplierTypes) {
$typesname[$SupplierTypes['SupplierTypeSysId']] = $SupplierTypes['Title'];
}
}
?>
<!--Page main section start-->
<section id="min-wrapper" class="active">
<div id="main-content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<!--Top header start-->
<h3 class="ls-top-header">Suppliers</h3>
<!--Top header end -->
<!--Top breadcrumb start -->
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-home"></i></a></li>
<li class="active">Contacts</li><li class="active">Suppliers</li>
</ol>
<!--Top breadcrumb start -->
</div>
</div>
<!-- Main Content Element Start-->
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading minus">
<h3 class="panel-title" onclick="$('.minus').trigger('click')"><i class="fa fa-filter"></i> Filter By</h3>
<ul class="panel-control">
<li><a class="minus <?php if(count($this->searchData) == 0): ?>active <?php endif; ?>" href="javascript:void(0)"><i class="fa <?php if(!empty($this->searchData) ): ?>fa-angle-up large <?php else: ?> fa-angle-down large<?php endif; ?>"></i></a></li>
</ul>
</div>
<div class="panel-body" style="display:<?php if(!empty($this->searchData) ): ?>block <?php else: echo "none"; endif; ?>;">
<form role="form" class="ls_form" name="supplierFilter" action="/supplier/index" method="POST" autocomplete="false">
<div class="col-md-3">
<div class="form-group">
<label>Company Name</label>
<input type="text" name="companyName" onkeyup="get_company_autosuggest();" value="<?php echo $this->searchData['companyName']; ?>" class="form-control whbg checkvalue">
<input type="hidden" name="hidden_company_id" id="hidden_company_id" value="<?php echo $this->searchData['hidden_company_id']; ?>"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Services</label>
<select id="supplierservices" name="supplierservices" class="form-control" >
<option value="">select</option>
<?php
if (is_array($arrSupplierServices)) { $servicename = array();
foreach ($arrSupplierServices as $SupplierServices) {
$servicename[$SupplierServices['SupplierSerSysId']] = $SupplierServices['Title'];
$supplierservices = (isset($this->searchData['supplierservices']) && $this->searchData['supplierservices']== $SupplierServices['SupplierSerSysId'])?'selected':'';
//@$selected = (in_array($SupplierServices['SupplierSerSysId'], $servicesMasking)) ? 'selected' : '';
echo "<option value='$SupplierServices[SupplierSerSysId]' $supplierservices>$SupplierServices[Title]</option>";
}
}
?>
</select>
</div>
</div>
<!--<div class="col-md-3">
<div class="form-group">
<label>Country</label>
<input type="text" name="country" id="country" onkeyup="get_country_autosuggest('country', 'hidden_selected_country_id');" value="<?php echo $this->searchData['country']; ?>" class="form-control whbg checkvalue">
<input type="hidden" name="country_id" id="hidden_selected_country_id" value="<?php echo $this->searchData['country_id']; ?>"/>
</div>
</div>-->
<div class="col-md-3">
<div class="form-group">
<label>Supplier City</label>
<input type="text" name="Destination" onkeyup="get_city_autosuggestOwn();" value="<?php echo $this->searchData['Destination']; ?>" class="form-control whbg checkvalue">
<input type="hidden" name="hidden_city_id" id="hidden_city_id" value="<?php echo $this->searchData['hidden_city_id']; ?>"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Agents Location</label>
<input type="text" id="location" name="location" onkeyup="get_location_autosuggest();" value="<?php echo $this->searchData['location']; ?>" class="form-control whbg checkvalue">
<input type="hidden" name="hidden_location_id" id="hidden_location_id" value="<?php echo $this->searchData['hidden_location_id']; ?>"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Contact Name</label>
<input type="text" name="contactName" value="<?php echo $this->searchData['contactName']; ?>" class="form-control whbg">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Mobile No</label>
<input type="text" name="phoneNo" value="<?php echo $this->searchData['phoneNo']; ?>" class="form-control whbg">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Email ID</label>
<input type="text" name="emailId" value="<?php echo $this->searchData['emailId']; ?>" class="form-control whbg">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Expertise City</label>
<div class="col-md-12 no-padding">
<input name="city" id="city" class="form-control whbg citychange" type="text" value="<?php echo $this->searchData['city']; ?>" onkeyup="get_city_autosuggest('city', 'hidden_selected_city_id', 'hidden_selected_country_id');" maxlength="35" />
</div>
<input type="hidden" name="city_id" id="hidden_selected_city_id" value="<?php echo $this->searchData['city_id']; ?>" />
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Expertise Country</label>
<select id="geographyCountry" name="geographyCountry" class="demo-default selectCountry" >
<option value="">Select</option>
<?php
foreach ($this->countryList as $countryList) {
@$selected = $supplierservices = (isset($this->searchData['geographyCountry']) && $this->searchData['geographyCountry']== $countryList['ContId'])?'selected':'';
//echo "<option value='$SupplierServices[SupplierSerSysId]' $selected>$SupplierServices[Title]</option>";
echo "<option value='$countryList[ContId]' $selected>$countryList[Title]</option>";
}
?>
</select>
</div>
</div>
<div class="col-md-12" align="right">
<div class="form-group form-group1">
<a href="<?php echo $this->baseUrl('supplier'); ?>" class="btn btn-primarygray" type="cancel">Cancel</a>
<button class="btn btn-primary"><i class="fa fa-search"></i> Filter</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-12">
<div class="successMessage">
<?php
if ($this->msg == 1) {
echo "Supplier added/updated successfully";
}
if (!empty($this->messages)) {
echo ($this->messages[0]);
}
?>
</div></div>
<div class="col-md-12">
<div class="leadeBorder">
<div class="panel-body">
<div class="form-group form-group1 text-right"><a href="<?php echo $this->baseUrl('supplier/add-agency-supplier'); ?>" class="btn btn-warning btn-sm"><i class="fa fa-fw fa-arrows"></i> Add Suppliers</a></div>
<div class="table-responsive ls-table">
<table class="table table-bordered table-striped table-bottomless" id="ls-editable-table">
<thead>
<tr class="alert alert-success">
<th>Company Name</th>
<!--<th>Supplier Name</th>-->
<th>Contact Name</th>
<th>Designation</th>
<th>Email Id</th>
<th>Contact No.</th>
<th>City(Country)</th>
<th>Category</th>
<th>Service</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($supplierListArr) ) {
foreach ($supplierListArr as $supplierList) {
$objSupplier = new Travel_Model_TblSupplier();
$servicesMasking = $objSupplier->getMasking($supplierList['Services'], $arrSupplierServices, 'SupplierSerSysId');
$supplierTypeMasking = $objSupplier->getMasking($supplierList['Type'], $SupplierTypeArrDB, 'SupplierTypeSysId');
$getservice = array(); $gettype = array();$getcityName = array();$getconName = array();
foreach ($servicesMasking as $value) {
$getservice[] = $servicename[$value];
}
foreach ($supplierTypeMasking as $value) {
$gettype[] = $typesname[$value];
}
// $C1 = explode(',',trim($supplierList['ConCitySysId']));
// $C2 = explode(',',trim($supplierList['ExpertiseDestinationsId']));
//
// $CN1 = explode(',',trim($supplierList['ConCountrySysId']));
// $CN2 = explode(',',trim($supplierList['ExpertiseCountriesId']));
// $result=array_merge($C1,$C2);
// $result2=array_merge($CN1,$CN2);
// if(array_unique($result)){
// foreach (array_unique($result) as $ctid) {
// $getcityName[] = Zend_Controller_Action_HelperBroker::getStaticHelper('Supplier')->CityNameById($ctid);
// }
// }
// if(array_unique($result2)){
// foreach (array_unique($result2) as $cnid) {
// $getconName[] = Zend_Controller_Action_HelperBroker::getStaticHelper('Supplier')->CountryNameById($cnid);
// }
// }
$strservice = (strlen(implode(',',$getservice)) > 20) ? substr(implode(', ',$getservice),0,20).'...' : implode(', ',$getservice);
$strtypes = (strlen(implode(',',$gettype)) > 7) ? substr(implode(', ',$gettype),0,7).'..' : implode(', ',$gettype);
$getcityName = trim($supplierList['CityNameString']);
$strcityName = (strlen($getcityName) > 20) ? substr($getcityName,0,20).'..' : $getcityName;
//$strconName = (strlen(implode(',',$getconName)) > 20) ? substr(implode(', ',$getconName),0,20).'...' : implode(', ',$getconName);
$getconName = trim($supplierList['CountryNameString']);
$ex = explode(',',$getconName);
$getconName = implode(', ',$ex);
$strconName = (strlen($getconName) > 20) ? substr($getconName,0,20).'...' : $getconName;
//echo '<pre>';print_r(array_unique($result));echo '</pre>';
?>
<tr>
<td><?php echo trim($supplierList['SupplierName']) ? ucfirst(trim($supplierList['SupplierName'])) : 'NA' ?></td>
<!--<td nowrap><?php ///echo trim($supplierList['ContactPerson']) ? ucfirst(trim($supplierList['ContactPerson'])) : 'NA' ?></td>-->
<td nowrap><?php echo trim($supplierList['Contact_Person']) ? ucfirst(trim($supplierList['Contact_Person'])) : 'NA' ?></td>
<td><?php echo trim($supplierList['ConProfileTitle']) ? trim($supplierList['ConProfileTitle']) : 'NA' ?></td>
<td><?php echo trim($supplierList['ConEmailId']) ? trim($supplierList['ConEmailId']) : 'NA' ?></td>
<td><?php echo trim($supplierList['ConPrimaryMobile']) ? trim($supplierList['ConPrimaryMobile']) : 'NA' ?></td>
<td nowrap title="<?=($getcityName) ? $getcityName : 'NA';?>"> <?php echo ($strcityName) ? $strcityName : 'NA' ?> (<span style="font-weight:500;" title="<?=($getconName) ? $getconName : 'NA';?>" ><?php echo ($strconName)?$strconName:'';?> </span>) </td>
<td title="<?=($gettype) ? implode(', ',$gettype) : 'NA';?>"><?php echo ($strtypes) ? $strtypes : 'NA';//print_r($servicesMasking); ?></td>
<td title="<?=($getservice) ? implode(', ',$getservice) : 'NA';?>"><?php echo ($strservice) ? $strservice : 'NA'; ?></td>
<td>
<!--<a href="<?php //echo $this->baseUrl('supplier/supplier-details/id/' . $supplierList['SupplierSysId']); ?>" class="btn btn-xs btn-success tooltipLink" data-toggle="tooltip" data-placement="top" title="View"><i class="fa fa-eye"></i></a>-->
<a href="<?php echo $this->baseUrl('supplier/edit-agency-supplier/id/' . $supplierList['SupplierSysId']); ?>" class="btn btn-xs btn-warning tooltipLink" data-toggle="tooltip" data-placement="top" title="Edit"><i class="fa fa-pencil-square-o"></i></a>
</td>
</tr>
<?php
}
} else {
?>
<tr><td colspan="9">No. records found</td></tr>
<?php } ?>
</tbody>
</table>
</div>
<!--Table Wrapper Finish-->
<div class="panel-box clearfix">
<?php if (!empty($this->paginator) ) { ?>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<!-- Main Content Element End-->
</div>
</div>
<?php echo $this->render('copyrightfooter.phtml'); ?>
</section>
<!--Page main section end -->
<?php echo $this->render("newfooter.phtml"); ?>
<!--Page main section end -->
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/jquery-ui.css'); ?>">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/bootstrap3-typeahead.js'); ?>"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/selectCityTypeahead.js'); ?>"></script>
<script type="text/javascript">
$('.selectCountry').selectize();
setTimeout(function () {
$('.successMessage').delay(3000).fadeOut('slow');
}, 3000);
function get_company_autosuggest() {
$("input[name=hidden_company_id]").val('');
$("input[name=companyName]").autocomplete({
source: '/supplier/autosuggest-company',
minLength: 2,
focus: function (event, ui) {
event.preventDefault();
//alert(ui.item.value);
$("#tags").val(ui.item.label);
},
select: function (event, ui) {
event.preventDefault();
$("input[name=companyName]").val(ui.item.label);
$("#hidden_company_id").val(ui.item.value);
//set city blank
//$("input[name=city]").val('');
//$("#hidden_selected_city_id").val('');
}
});
}
function get_city_autosuggestOwn() {
$("input[name=hidden_city_id]").val('');
$("input[name=Destination]").autocomplete({
source: '/supplier/autosuggestcity',
minLength: 2,
focus: function (event, ui) {
event.preventDefault();
//alert(ui.item.value);
$("#tags").val(ui.item.label);
},
select: function (event, ui) {
event.preventDefault();
$("input[name=Destination]").val(ui.item.label);
$("#hidden_city_id").val(ui.item.value);
//set city blank
//$("input[name=city]").val('');
//$("#hidden_selected_city_id").val('');
}
});
}
function get_country_autosuggest(inputId, hiddenInputId) {
$('#' + inputId).typeahead({
items: 'all',
source: function (query, process) {
$('#' + hiddenInputId).val('');
return $.ajax({
url: '/general/suggest-country',
type: 'post',
async: false,
data: {query: query},
dataType: 'json',
success: function (result) {
var resultList = result.map(function (item) {
var aItem = {ContId: item.ContId, Title: item.Title};
return JSON.stringify(aItem);
});
return process(resultList);
}
});
},
sorter: function (items) {
var beginswith = [], caseSensitive = [], caseInsensitive = [], item;
while (aItem = items.shift()) {
var item = JSON.parse(aItem);
if (!item.Title.toLowerCase().indexOf(this.query.toLowerCase()))
beginswith.push(JSON.stringify(item));
else if (~item.Title.indexOf(this.query))
caseSensitive.push(JSON.stringify(item));
else
caseInsensitive.push(JSON.stringify(item));
}
return beginswith.concat(caseSensitive, caseInsensitive)
},
highlighter: function (obj) {
var item = JSON.parse(obj);
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
return item.Title.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>'
})
},
updater: function (item) {
var item = JSON.parse(item);
$('#' + hiddenInputId).val(item.ContId);
return item.Title;
},
minLength: 2,
displayField: 'Title',
});
}
function get_location_autosuggest() {
$("input[name=hidden_location_id]").val('');
$("input[name=location]").autocomplete({
source: '/supplier/autosuggestlocation',
minLength: 2,
focus: function (event, ui) {
event.preventDefault();
//alert(ui.item.value);
$("#tags").val(ui.item.label);
},
select: function (event, ui) {
event.preventDefault();
$("input[name=location]").val(ui.item.label);
$("#hidden_location_id").val(ui.item.value);
//set city blank
//$("input[name=city]").val('');
//$("#hidden_selected_city_id").val('');
}
});
}
$('.checkvalue').on('change', function(){
var location = $("input[name=location]").val();
var Destination = $("input[name=Destination]").val();
var companyName = $("input[name=companyName]").val();
if(location === ''){
$("input[name=hidden_location_id]").val('');
}
if(Destination === ''){
$("input[name=hidden_city_id]").val('');
}
if(companyName === ''){
$("input[name=hidden_company_id]").val('');
}
console.log(location);
});
</script>