Friday, 27 October 2017
Get Place Image url In google map Api
How to get place image url in google map api:
Here is the working code
var src = place.photos[0].getUrl({'maxWidth': 150, 'maxHeight': 150});
Here is the working code
var src = place.photos[0].getUrl({'maxWidth': 150, 'maxHeight': 150});
Wednesday, 25 October 2017
Google Map Api Correct Position For InfoWindow On Marker
Google Map Api Correct Position For InfoWindow On Marker:
Here is example code:
var infowindow = new google.maps.InfoWindow({
content:hello
});
marker.addListener('click', function() {
infowindow.open(map, this);
});
Here is example code:
var infowindow = new google.maps.InfoWindow({
content:hello
});
marker.addListener('click', function() {
infowindow.open(map, this);
});
Saturday, 21 October 2017
Angularjs4 Routes Example Strucutre
here is the Angularjs4 Routes Example Strucutre:
const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'about', component: AboutComponent },
{ path: 'contat', component: ContactComponent }
];
Here to call the Routes data:
<a href="https://www.blogger.com/null" routerlink="/home" routerlinkactive="active">home</a><br />
<a href="https://www.blogger.com/null" routerlink="/about" routerlinkactive="active">about</a><br />
<router-outlet></router-outlet>
const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'about', component: AboutComponent },
{ path: 'contat', component: ContactComponent }
];
Here to call the Routes data:
<a href="https://www.blogger.com/null" routerlink="/home" routerlinkactive="active">home</a><br />
<a href="https://www.blogger.com/null" routerlink="/about" routerlinkactive="active">about</a><br />
<router-outlet></router-outlet>
Delete Query In Codeigniter
Here please check Delete Query In Codeigniter Example:
$this->db->where('id', $id);
$this->db->delete('users');
$this->db->where('id', $id);
$this->db->delete('users');
Friday, 20 October 2017
Insert Query In Codeigniter
Here you can check Insert Query In Codeigniter:
$data = array(
'name' = > $_POST['name'] ,
'email'= > $_POST['email'],
'pass' = > $_POST['pass'] );
$this-> db->insert('users', $data);
$data = array(
'name' = > $_POST['name'] ,
'email'= > $_POST['email'],
'pass' = > $_POST['pass'] );
$this-> db->insert('users', $data);
Saturday, 14 October 2017
How to run angularjs4 without ng serve and npm start commands?
How to run angularjs4 without ng serve and npm start commands?:
Write "ng build" query in you compiler and you can dist folder into your angularjs app, then you can run your app with server easily
Sunday, 8 October 2017
Price Sort Number Value Wordpress Meta Value
/*Price Sort Number Value*/
function alter_query_so_15250127($query) {
if ( !is_admin() && $query->is_main_query() && is_archive()) {
$query->set('post_type','listings');
$query->set('meta_key', 'price_value');
$query->set('orderby', 'meta_value_num');
$query->set('order', 'DESC');
}
}
add_action('pre_get_posts','alter_query_so_15250127');
if ( !is_admin() && $query->is_main_query() && is_archive()) {
$query->set('post_type','listings');
$query->set('meta_key', 'price_value');
$query->set('orderby', 'meta_value_num');
$query->set('order', 'DESC');
}
}
add_action('pre_get_posts','alter_query_so_15250127');
Angular2 : Create a Simple Angular2 Component
How to Create a Simple Angular2 Component and here is that command:
ng generate component test-component --inline-template
ng generate component test-component --inline-template
Tuesday, 12 September 2017
Add multiple categories to body class Wordpress
SOLUTION
You can add this code to your custom functions.php file:
function add_categories( $classes = '' ) {
$categories = get_the_category();
foreach( $categories as $category ) {
$classes[] = 'category-'.$category->slug;
}
return $classes;
}
add_filter( 'body_class', 'add_categories' );
Fill Input Field with selected option with jquery
Here this you can use jquery on change function, check the example:
$("progadi").on("change", function() {
var val = $(this).val();
// put the val in other field
$("strata").val(val);
});
Monday, 4 September 2017
Ajax Post Request With Json Datatype In Jquery
Here is the code for Ajax Post Request With Json Datatype In Jquery:
| $.ajax( | |
| { | |
| type: 'POST', | |
| url: 'RequestHandler/RegisterationHandler.php?ZipVal=' + ZipVal, | |
| data_type: 'json', | |
| data: { "ZipVal": ZipVal }, | |
| success: function (data) | |
| { } }); |
Thursday, 24 August 2017
Wordpress Hook Add custom HTML in New Tab on Product Page IN WooCommerce
Here is the code for Wordpress Hook Add custom HTML in New Tab on Product Page IN WooCommerce :
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs['desc_tab'] = array(
'title' => __( 'Additional Information', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);
}
function woo_new_product_tab_content() {
// The new tab content
echo '<p>Lorem Ipsum</p>';
}
Tuesday, 22 August 2017
One month in Custom Range Validation for daterangepicker
Here is the code for One month in Custom Range Validation for daterangepicker:
$('#reportrange').daterangepicker({
startDate: start,
endDate: end,
ranges: {
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'),
moment().subtract(1, 'month').endOf('month')]
},
"dateLimit": {
"month": 1
},
}, cb);
Monday, 21 August 2017
Multiple Count With Case Condition IN Mysql Laravel
Here is the code for Multiple Count With Case Condition IN Mysql Laravel :
public function piechartdata()
{
$orders = Order::select(
DB::raw("
COUNT(CASE status WHEN '1' THEN 'OrderPlaced' ELSE NULL END) as OrderPlaced,
COUNT(CASE status WHEN '3' THEN 'Rejected' ELSE NULL END) as Rejected,
COUNT(CASE status WHEN '4' THEN 'Failure' ELSE NULL END) as Failure,
COUNT(CASE status WHEN '6' THEN 'Delivered' ELSE NULL END) as Delivered")
)
->where('orders.active', 1)
->orderBy('id','desc')
->get();
return response()->json(['data' => $orders], 200);
}
public function piechartdata()
{
$orders = Order::select(
DB::raw("
COUNT(CASE status WHEN '1' THEN 'OrderPlaced' ELSE NULL END) as OrderPlaced,
COUNT(CASE status WHEN '3' THEN 'Rejected' ELSE NULL END) as Rejected,
COUNT(CASE status WHEN '4' THEN 'Failure' ELSE NULL END) as Failure,
COUNT(CASE status WHEN '6' THEN 'Delivered' ELSE NULL END) as Delivered")
)
->where('orders.active', 1)
->orderBy('id','desc')
->get();
return response()->json(['data' => $orders], 200);
}
Solved : Chartjs Bar Chart showing old data when hovering
Here is the Solved code for Chartjs Bar Chart showing old data when hovering:
var ctxLine = document.getElementById("line-chart").getContext("2d");
if(window.bar != undefined)
window.bar.destroy();
window.bar = new Chart(ctxLine, {});
var ctxLine = document.getElementById("line-chart").getContext("2d");
if(window.bar != undefined)
window.bar.destroy();
window.bar = new Chart(ctxLine, {});
Custom Button Click Function To Refresh Datatable Record Without Page load
Here is the code for Custom Button Click Function To Refresh Datatable Record Without Page load:
$(document).on("click", '.refreshRecords', function (e) {
$('#dTableOrder').DataTable().ajax.reload(null, true);
});
$(document).on("click", '.refreshRecords', function (e) {
$('#dTableOrder').DataTable().ajax.reload(null, true);
});
Sunday, 20 August 2017
Get html form post value in same page in php file
Here is the working code for Get html form post value in same page in php file:
<?php
if(isset($_POST['button'])){ //check if form was submitted
$pohlavie = $_POST['gender']; //get input text
$plat = $_POST['salary']; //get input text
echo "Your gender is ".$pohlavie." and your salary is ".$plat;
}
?>
<center><h1>TAXES</h1></center>
<form action="" method="post">
Name: <input type="text" name="name"><br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="male"> Male<br>
Salary: <input type="number" name="salary"><br>
<button type="submit" name="button" formmethod="post">Calculate DPH</button>
</form>
Subscribe to:
Posts (Atom)
-
SOLUTION You can add this code to your custom functions.php file: function add_categories ( $classes = '' ) { $categ...
