Simple filter in ionic / angular



/// first create duplicate temp variable of variable used in the forloop


onSearch(evt: any) {
        console.log(evt.target.value);
        const val = evt.target.value;
        this.usersList = [];
   
        const temp = this.tempUsers.filter(function(d) {
      return String(d.ecn).toLowerCase().indexOf(val) !== -1 ||
      d.fullname.toLowerCase().indexOf(val) !== -1 ||
      d.gender.toLowerCase() === val ||
      d.department.toLowerCase().indexOf(val) !== -1 ||
      String(d.doj).toLowerCase().indexOf(val) !== -1 || !val;
    });

    // update the rows
    this.usersList = temp;
    }

Add translator to ionic app



HOW TO BUILD IONIC 3 MULTI-LANGUAGE APP

This is going to be very interesting , we are going to do it one by one
Step -1 Start new ionic app:
 
       ionic start multilingual
Step 2: Installing angular translate and setup in ionic app:
npm install @ngx-translate/core @ngx-translate/http-loader — save
Step-3 Firstly import into your Service:
import { TranslateModule } from ‘@ngx-translate/core’;
Step -4 Secondly add into array import Section
imports:[
BrowserModule,
IonicModule.forRoot(MyApp),
TranslateModule.forRoot()
],
Step-5 Setting up folder location for ionic 3
This step is very important .Make folder under asssets section src/assets/i18n/ folder.
In app.module.ts import the following modules:-
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
export function setTranslateLoader(http: Http) {
 return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
and config Object for .root import following Modules
imports: [
  BrowserModule,
  IonicModule.forRoot(MyApp),
  HttpClientModule,
  TranslateModule.forRoot({
  loader: {
   provide: TranslateLoader,
   useFactory: (setTranslateLoader),
   deps: [HttpClient]
 }
})],
Okay we are almost done with angular translate now it’s time to set default language into app.component.ts file. So first import the TranslateServiceand inject it into constructor:
import { TranslateService } from '@ngx-translate/core';export class MyApp {
rootPage:any = TabsPage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, translate: TranslateService) {
 translate.setDefaultLang('en');
 platform.ready().then(() => {
 statusBar.styleDefault();
 splashScreen.hide();
});
}
Step 4: Add the language files for each language
In Src/assets/i18n folder under create json files .In Which language uh want to import so You have to add files per language. I have create 2 files for English and German (en.json and de.json)
Here is how my both files looks like :
<strong>en.json</strong>
{
"home":"Home",
"about": "About",
"contact": "Contact",
"welcome":"Welcome to ionic",
}
These files contains JSON Object so that we can easily access them by using keys of object.
<strong>de.json</strong>
{
  "home": "huis",
  "about": "over",
  "contact": "Contact",
  "welcome": "Welkom bij ionic!",
}
Step 5: Using translation pipes to translate text in html pages
ex. In home.html page under pages folder
<h2>{{"home" | translate }}</h2>
<p> 
 {{ "about" | translate }}
</p>
<p> 
 {{"welcome" | translate }}
</p>
Hi, My name is Saloni Malhotra. I am a Javascript Developer and writer. I am here to talk so Don’t hesitate to Drop me a message.if you like my story Please Click ❤ and share with everyone.
Thanks !!
Happy coding

How to increase Internet Speed?



how to increase internet speed?

-increase the connectivity make sure that the wifi signal is strong

-uninstal unwanted apps

-reset the system

-clear browsing history,cookies from your browsers

disable button on click for a few seconds

<button id="input-sales-btn" class="btn btn-success" onclick="inputBtnClicked('sales');this.disabled=true;
setTimeout(function(){ $('#input-sales-btn').removeAttr('disabled'); }, 15000);">Done
                    </button>

redirect or logout user from a php application very easy

 <?php
$variablephp = $_SESSION['uname'];
?>
    <script>
   
    setInterval(function() {
  // method to be executed;
       
        var variablejs = "<?php echo $variablephp; ?>" ;
alert("variablejs = " + variablejs);
        if(){}
       
}, 5000);
   
    </script>

Create an Android App from a Responsive website Easy.

The below code will help you create a Android app from your responsive website.Please copy this HTML code to the index file of your cordova project and then build the project.Change logo in your cordova project with your respective logos.

<head>
    <title>Home</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    // device APIs are available
    //
    function onDeviceReady() {
        // Register the event listener
        document.addEventListener("backbutton", onBackKeyDown, false);
    }

    // Handle the back button
    //
    function onBackKeyDown() {

magic();
    }


function magic (){

    $("#button").click(function(event){    
        //var h = document.getElementById("myIFrame").contentWindow.history;
       
        //h.back();
     
        $("#myIFrame").attr('src', window.history.back());
    });

}

    </script>
  </head>





<script
  src="https://code.jquery.com/jquery-3.1.1.js"
  integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA="
  crossorigin="anonymous"></script>
<iframe id="myIFrame" src="http://yourwebsite.com" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;" scrolling="yes" frameborder="0" allowTransparency="true"></iframe>

<script>

</script>

Easy MD5 password Encryption Decryption Example using php



Here are the main lines of code the encrypt the password


PART 1 Password Encryption 
//get the password in variable
$password = isset($_GET['password']) ? mysql_real_escape_string($_GET['password']) :  "";

//here n5tZoJDknmUgY6LR21FFr4SAoQK8ACajoO3egV0I2JU4Uu8ihuk20hgm is the hashkey do save it
//encrypt using the below syntax then insert into database

 $password = md5("n5tZoJDknmUgY6LR21FFr4SAoQK8ACajoO3egV0I2JU4Uu8ihuk20hgm".$password."");

==========================================================

Here below is the full code I used

<?php header('Access-Control-Allow-Origin: *'); ?>
<?php header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); ?>
<?php header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT'); ?>

<?php

//echo "hi there";


include_once('confi.php');
error_reporting(E_ALL);
$name = isset($_GET['name']) ? mysql_real_escape_string($_GET['name']) :  "";
$email = isset($_GET['email']) ? mysql_real_escape_string($_GET['email']) :  "";
$password = isset($_GET['password']) ? mysql_real_escape_string($_GET['password']) :  "";
    $password = md5("n5tZoJDknmUgY6LR21FFr4SAoQK8ACajoO3egV0I2JU4Uu8ihuk20hgm".$password."");
$uid = isset($_GET['uid']) ? mysql_real_escape_string($_GET['uid']) :  "";
    $idshop = isset($_GET['idshop']) ? mysql_real_escape_string($_GET['idshop']) :  "";
    if(!empty($uid)){
        $query = "SELECT * FROM ps_customer WHERE email = '$email' AND id_shop='$idshop'";
        $qur = mysql_query($query);
        $existCount = mysql_num_rows($qur); // count the row nums
if ($existCount == 0) { // evaluate the count
//echo "Proceed";
 
    $securekey = md5(uniqid(rand(), true));
   
     $insertstatement = "INSERT INTO `ps_customer` (`id_customer`, `id_shop_group`, `id_shop`, `id_gender`, `id_default_group`, `id_lang`, `id_risk`, `company`, `siret`, `ape`, `firstname`, `lastname`, `email`, `passwd`, `last_passwd_gen`, `birthday`, `newsletter`, `ip_registration_newsletter`, `newsletter_date_add`, `optin`, `website`, `outstanding_allow_amount`, `show_public_prices`, `max_payment_days`, `secure_key`, `note`, `active`, `is_guest`, `deleted`, `date_add`, `date_upd`) VALUES (NULL, '1', '$idshop', '1', '3', '1', '0', NULL, NULL, NULL, '', '$name', '$email', '$password',NOW(), '2000-01-01', '0', NULL, '0000-00-00 00:00:00', '0', NULL, '0.000000', '0', '0', '$securekey', NULL, '1', '0', '0', NOW(), NOW());";
  //  echo $insertstatement;
    $query123 = mysql_query($insertstatement);
   
   
    $selectquery = "SELECT MAX(id_customer) a FROM `ps_customer`;";
  //  echo "$selectquery";
   
     $query1 = mysql_query($selectquery);
  //  echo"test" ;
    while($row = mysql_fetch_array($query1)) {
       
      $id_customer = $row['a'];
       //  $id_customer1 = int($id_customer) + 1;
    }
   // echo "'.$id_customer.' i am first";
    //$id_customer1 = $id_customer + 1;
   // echo "$id_customer1";

    $insert2 = "INSERT INTO `ps_customer_group` (
`id_customer` ,
`id_group`
)
VALUES (
'$id_customer',  '3'
);";
   
   //echo "$insert2";
    $query123 = mysql_query($insert2);
    $true = "true";
    $result[] = array("status" => $true,"id_customer" => $id_customer);
   $json = $result;

   
}else{
    $false = "false";
//echo "Your login session data already exists in the database.";
    $result[] = array("status" => $false);
   $json = $result;
   
}
}
@mysql_close($conn);
/* Output header */
header('Content-type: application/json');
echo json_encode($json);


//echo "$query i m qwedrdfrd";
//echo "$existCount i m exist";
//echo "$insertstatement";



PART 2 Password Decryption 

Below is an example of login where we select the user from database here MD5 Decryption is used.

<?php
// Include confi.php
include_once('confi.php');
$shopid = isset($_GET['shopid']) ? mysql_real_escape_string($_GET['shopid']) :  "";
$email = isset($_GET['email']) ? mysql_real_escape_string($_GET['email']) :  "";
$passwd1 = isset($_GET['passwd']) ? $_GET['passwd'] :  "";
if(!empty($email)){
        $mysql = "select id_customer,firstname,lastname,passwd,email from ps_customer where email = '".$email."' AND id_shop='".$shopid."'";
       // echo "$mysql";
$qur = mysql_query($mysql);
$result =array();
while($r = mysql_fetch_array($qur)){
extract($r);
            //echo "$r";
$passwd1 = md5("n5tZoJDknmUgY6LR21FFr4SAoQK8ACajoO3egV0I2JU4Uu8ihuk20hgm".$passwd1."");

if($passwd1 ==$passwd){

 $result[] = array("id_customer" => $id_customer, "firstname" => $price,"lastname" => $lastname, 'passwd' => $passwd, 'email' => $email);
 }else{}}
$json = $result;
}else{
$json = array("status" => 0, "msg" => "User ID not define");
}
@mysql_close($conn);

/* Output header */
header('Content-type: application/json');
echo json_encode($json);


Create a Product Grid using Json

Here is the Part 1
 

Here is the Part 2
 

Here is the Part 3
 

Here I have posted all the three Videos to Create the product Grid.
Download the project from here
http://joethemes.com/?ddownload=7455

Dear Guys in this video I show you how to populate the product grid with JSON data.Note that this JSON data was created using PHP language.Comment your doubts below in the comment section.
Share this Video with your friends if you found this helpful!

View my Blog
http://www.joelwebsites.com

View my Website
http://www.joethemes.com


Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes

Recommended BlueHost Webhosting
https://www.bluehost.com/track/easyregistration/

Remove background noise from videos using Adobe Premier Pro cc





View my Blog

http://www.joelwebsites.com



Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes



RELATED VIDEOS



fade volume

https://youtu.be/gBxbp0fy30I



Improve audio

https://youtu.be/loz4nP_KZkU



Dear Guys,

In this Video I show you how to remove noise from audio using denoiser it is an easy tutorial and should be easy to follow.

I hope you enjoy watching the video thank you.

#Angular & JavaScript Series - On Ready function & Asynchronous code



Dear Guys This is the third Video in the Series I show you about the On Ready function and some small explanation for Asynchronous Javascript Code..

View My Blog
http://www.joelwebsites.com

Subscribe to my channel for More Videos :)
http://www.youtube.com/subscription_center?add_user=joeljfernandes

Cheap lighting for videos | Create Good Videos | Importance of lighting ...



Dear Guys,
I have tried to improve the lighting in my house to so thought I will show you what difference it made...
I how cost effective it is to improve video quality by just improving the lighting!
I hope that you enjoy watching this Video.Take Care Guys!


View my Blog
http://www.joelwebsites.com

Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes

Moon Timelapse Video | Magic Lantern | Canon 700d T5i 55-250 mm kit lens...





Dear Guys,

I thought of Creating this video to show you how to Video Record the moon.

I used the zoom kit lens lens 55-250 mm to record the video.I used the magic crop in magic lantern to obtain the zoom,

I hope that this Video was useful to help you know the settings that I have used.

I hope you enjoyed watching the Video!



Song in this video

DEAF KEV - Invincible



View my Blog

http://www.joelwebsites.com



Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes

Create your Website in Minutes free | Create a Website Easy Tutorial





Visit Wix Using this link

http://wixstats.com/?a=7163&c=124&s1=



View the Website here

http://joeljfernandes.wix.com/joelwebsites



Dear Guys in this Video I show you how I Create a Very simple yet powerful website.This website can be used for your business purposes too since it its Very Elegant and Professional.



Many people think that Website Creation is a very complicated task and difficult but in this Video I have proved you wrong.

I hope you have enjoyed watching this Tutorial.



View my Blog

http://www.joelwebsites.com



Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes

#DoNotLitter KEEP THE PLACE YOU LIVE CLEAN | Joel Vlog at Bhuigauv beach...



Dear Guys in this Video I show you the beach in Vasai.This beach is called bhuigao beach.This Beach is a really beautiful beach but few days ago I visited the beach I found the surrounding littered with a lot of plastic bags and many funny things I urge you to share this page with others so that people are always aware to keep their surrounding clean.Take care guys.Stay updated for more Videos.

sqllite Easy Tutorial



Here is the Video


Dear Guys,
In this Video I show you how to set up a simple Sqlite database using js.This database will be very useful for you Cordova or phone gap app database.I hope you enjoy watching this Video.
Share your thoughts and questions below.Take care Guys!

View my Blog
http://www.joelwebsites.com

Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes

Below is the code to help you understand the basic Note that the same code was used in the Video.


function DBHelper() {
    var database = window.openDatabase("DoctorChat", "1.0", "DoctorChat", 200000);
    return database;
}

function SuccessDB(tx) {
    alert('Successfully Inserted.');
    
}

function SucessCreateTable(tx) {
    //alert('Successfully Table Created.');
  
}

function ErrorDB(error) {
    alert('Error : ' + error.message);
}

function ErrorInsertDB(error) {
    alert('Error when inserting : ' + error.message);
}

var Syncanswertable = function () {
alert('Syncanswertable');
//PRIMARY KEY (ID),
    
     var url = 'http://joethemes.com/chatadmin/webservices/getanswers.php?uid=1';
     $.post(url, function(data){
    DBHelper().transaction(function (tx) {
   tx.executeSql('CREATE TABLE IF NOT EXISTS app_getanswers(ID Text, question Text, answer Text, weight Text, synonyms Text, other Text)');
});

//DBHelper().transaction(function (tx) { tx.executeSql("DELETE FROM app_getanswers"); });

DBHelper().transaction(function (tx) {

        
       
        var length = localStorage.getItem('length');
        
        if(length == null){length = 0;}
        
        
        alert(length+'i am length');
        if(length < data.length){
            
        localStorage.setItem('length',data.length);
        alert(data.length+'i am getanswers');
        tx.executeSql("DELETE FROM app_getanswers");
   for (var cnt = 0; cnt < data.length; cnt++) {

       var ID = data[cnt].CashRegisterID;
       var question = data[cnt].question;
       var answer = data[cnt].answer;
       var weight = data[cnt].weight;
       var synonyms = data[cnt].synonyms;
       var other = data[cnt].other;

       tx.executeSql("INSERT INTO app_getanswers(ID, question, answer, weight, synonyms, other) values('" + ID + "', '" + question + "', '" + answer + "', '" + weight + "', '" + synonyms + "', '" + other + "' " + ");");
   }
}
 
}, ErrorDB, SucessCreateTable);
           /* DBHelper().transaction(function (tx) {
       // NOT NULL AUTO_INCREMENT
       tx.executeSql('CREATE TABLE IF NOT EXISTS app_getanswers(ID Text, question Text, answer Text, weight Text, synonyms Text, other Text,UNIQUE (question))');
   
    }, ErrorDB, SucessCreateTable);

    var url = 'http://joethemes.com/chatadmin/webservices/getanswers.php?uid=1';
     $.post(url, function(data){
   //alert(JSON.stringify(data)+'i am getanswers');
         //var getanswers = data; " + "
         
         
         for (var i = 0; i < data.length; i++) {
             
             //alert(data[i].question);
             var queryss = "INSERT OR REPLACE INTO app_getanswers(ID, question, answer, weight, synonyms , other) values( '" + data[i].ID + "'  , '" + data[i].question + "'  , '" + data[i].answer + "'  , '" + data[i].weight + "' , '" + data[i].synonyms + "' , '" + data[i].other + "' ); ";
                 alert(queryss);
             
             
             
             DBHelper().transaction(function (tx) {
       // NOT NULL AUTO_INCREMENT
                 
                 
       tx.executeSql(queryss);
   
    }, ErrorInsertDB, SuccessDB);
             
         }
         
         //var strQuery="INSERT INTO app_getanswers(ID, question, answer, weight, synonyms, other) Values(?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE subs_name     = VALUES("+subs_name+"),subs_birthday = VALUES("+subs_name+")";
            
         /*   $.each(data.d, function (index, store) {
            alert(store.StoreID);
            DBHelper().transaction(function (tx) {
            tx.executeSql(strQuery,[store.StoreID, store.Name, store.Address, store.State, store.City, store.CountryName]);
            }, ErrorDB, SuccessDB);
            
            });  
         
         
         */
         
        
    }).fail( function(jqXHR, textStatus, errorThrown) {
  alert('error occured');
});
    }
Syncanswertable();

function GetAnswers(question)
{
    // WHERE question LIKE %"+question+"%
    //alert('hi i amget answers');
    
    return new Promise(function(resolve, reject) {
    var question = 'hi';
var sqlData = "SELECT * FROM app_getanswers WHERE question LIKE '%"+question+"%'";
    alert(sqlData);
    DBHelper().transaction(function (tx) {
        tx.executeSql(sqlData, [], function (tx, results) {

            for (var i = 0; i < results.rows.length; i++) {
                //alert(results.rows.item(i).answer+'i am the answer');
                
                var answer = results.rows.item(i).answer;
                alert(answer);
                resolve(answer);
            }
            
        });
    },ErrorDB, function (data) {
        alert('success');
    });
    
     });       
   //return 5; 
}



how to increase website traffic for free - Tips by JoelWebsites





Some related articles that may help you are linked here



http://www.seopoint.com.au/blog/interlinking-websites-content-best-practices/



https://en.wikipedia.org/wiki/Backlink



Hey guys today I will show you how to increase traffic to your website..Nice video for people who have new websites...Having a website without is pointless having it... so here are some few tips to help you get some more traffic!  ... you may be wondering what is traffic?... traffic is people visiting your website, its not the traffic we see on roads..so do not get confused by hearing the word traffic because traffic has multiple meanings!



One of the important tips is to share your website on social media, but before you share the website to social media you need to ensure that your website has a blog.. if your website has a blog people tend to read the post and they may find the post engaging!... so if your website has a blog people tend to read all the post on your website if they find it interesting to them...So make sure that your post are engaging and interesting and try to make sure people will read the post for a long time!..This will help you increase the time that people are present on your website!



Here are some nice blogs that are successful

http://www.wikihow.com/Main-Page



http://www.shoutmeloud.com/



Use these above blogs as a reference and an example ... so you can apply similar strategies and then create your blog too! ...the point is to look at other people`s blog and then take ideas for yourself!



Next step is to optimize your blog with keywords! So lets say if you have a ladies top business the keywords would be red ladies top, Green ladies top for young girls ,black dress...This will vary based on many factors!



You can try going to google.com and then tyoe for a search phrase then you will see some related searches ...these are the searches that are being searched the most so I recommend you to use those keywords.This technique will help you find the correct keywords..



Once you got the keywords use these keywords in the title,meta description,url and the content...

Make sure that you do not spam too much using these keywords...

Google checks if you are following the webmaster guidelines...



Look at this link for the webmaster guidelines

https://support.google.com/webmasters/answer/35769

Make sure the website content is suitable for new users to read ... try to explain to new website users about your website niche step by step... use some sort of numbering to the post to be systematic!



Next tip is to ask your friends what they think about your website,just some feedback it will help you find some flaws! A bad user experience is not good for seo.



Design is not so important but make sure your website loads fast and is easy to navigate!



Next tip is to put attractive images on your website to enhance the user experience so will decrease the bounce rate! optimize the image tags using the alt attribute...



Try to make sure that your post are interlinked with each other look at the video to get an idea this will help the google crawler to crawl properly on your website.

Create official pages on all social media make sure you share your content there and be sure that people see your content...if people like your content they will like and share your posts hence creating backlinks to your website..Create such quality content that people share your post automatically...



Create backlinks make sure your webpages are linked to and from other websites...Similar applies for youtube videos make sure your videos are linked to other videos.



Do not over do Seo .. content is king! Create content on a regular basis rather than focusing too much on Seo strategies!



Never Buy traffic from Pay Per Click websites



Be patient and keep Creating Content and you will see seo work!




Insert or Update data securely using Json php webservices




Dear Guys I have created this video because I had got a comment on my before video on how to insert data securely using the Json webservices ...This is a frequently asked question so that is the reason why I have created this video..
In this video I have shown you the most important steps to set this type of code it should be really easy..

Below are the code for the most important files

register.php

<?php header('Access-Control-Allow-Origin: *'); ?>
<?php header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); ?>
<?php header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT'); ?>
<?php
include_once('confi.php');
error_reporting(E_ALL);

//Get the variables here
$username = isset($_POST['username']) ? mysql_real_escape_string($_POST['username']) :  "";
$email = isset($_POST['email']) ? mysql_real_escape_string($_POST['email']) :  "";
$password = isset($_POST['password']) ? mysql_real_escape_string($_POST['password']) :  "";
//Get the variables here end/update statement
$insertstatement = 'INSERT INTO `mytesttable`(`id`,`username`,`email`,`password`) VAlUES (NULL,"'.$username.'","'.$email.'","'.$password.'")';

$query123 = mysql_query($insertstatement) or trigger_error(mysql_error()." ".$insertstatement);

//echo "$query123";
//Registration code here (insert statements)

if($query123 == 1){

$result[] = array("status" => 1);
}else{
   $result[] = array("status" => 0); 
    
    
}
/* Output header */
header('Content-type: application/json');
echo json_encode($result);
?>


Post in the javascript that was in login.htm

$.post("http://localhost/loginangulartutorial/webservices/register.php",
    {
        password: confirmpassword,
        email: email,
        username: username
    },
    function(data, status){
        alert("Data: " + data + "\nStatus: " + status);
                
                var status = data[0].status;
                
                if(status == 1){
                    
                    alert('inserted /updated sucessfully');
                }
                if(status == 0){
                    
                    alert('failure statement');
                }
                

    });

I hope that this tutorial was helpful comment below my video in case you have doubts or questions..

Subscribe to my channel http://www.youtube.com/subscription_center?add_user=joeljfernandes

Retrieve Multiple Values using Json webservices



Dear Guys,
In this tutorial I show you how to retrieve multiple Values using Json webservices.

Here below is the code for the get answers file which is the most important which I had explained on the Video
getanswers.php
<?php header('Access-Control-Allow-Origin: *'); ?>
<?php header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); ?>
<?php header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT'); ?>
<?php
include_once('confi.php');
error_reporting(E_ALL & ~E_NOTICE);

$uid = isset($_GET['uid']) ? mysql_real_escape_string($_GET['uid']) :  "";
if(!empty($uid)){
$qur = mysql_query('SELECT * from app_getanswers ');
$result =array();
while($r = mysql_fetch_array($qur)){
extract($r);
//multiple values will be stored in the result varaible array
$result[] = array("ID" => $id,"question" => $question, "answer" => $answer, "weight" => $weight, "synonyms" => $synonyms, 'other' => $other);
            
          // $json = array("status" => 3, "msg" => "User ID not define");
            
}
$json = $result;
}else{
$json = array("status" => 0, "msg" => "UID not define");
}
@mysql_close($conn);

/* Output header */
header('Content-type: application/json');
echo json_encode($json);


Now here is the Javascript that is needed to get the data using the for loop
which is really simple

 var url = 'http://joethemes.com/chatadmin/webservices/getanswers.php?uid=1';
     $.post(url, function(data){

 for (var cnt = 0; cnt < data.length; cnt++) {

       var ID = data[cnt].ID;
       var question = data[cnt].question;
       var answer = data[cnt].answer;
       var weight = data[cnt].weight;

}
});


I hope that this article helped you ...If yes mention a comment below thank you :) View my Youtube channel here

How to Choose Blogging Platform? (Blogger Vs Wordpress)



How to Choose Blogging Platform?

You need to ask yourself one main question before you select your blogging platform..
You need to know what is your budget ..how much money you can afford as a person.

Another question you need to ask yourself is what is the main purpose for your website?
Is it going to be just for fun? or Is it something serious....
WordPress is for someone more serious whereas Blogger is for other users..
Blogger has a search Description section where you can enter in your keywords so you can optimize your posts for Google...

I hope you see the above video which will help you take a Good Decision...

Basic Angular File Structure for Most Applications




Hey Guys here I am sharing with you the Very basic file structure to start writing any Angular Js application...I hope it is useful in your projects

It consists of two main files

the html file and the js file


The HTML file will look like the following

<html ng-app="joealmodule" ng-controller="JoelController">
<head>
/*scripts to include jquery and angular and css*/
<link rel="stylesheet" type="text/css" href="style.css">

        <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script src="js/angular.min.js"></script>
    <script src="js/angular-animate.js"></script>
    <script src="js/pagination.js"></script>
    <script src="js/toastr/angular-toastr.min.js"></script>
    <script src="js/toastr/angular-toastr.tpls.min.js"></script>

    <script src="js/admin.js"></script>
</head>
<body>
</body>
<html>

Now here below you will see the admin.js file

var joelmodule = angular.module("joelmodule",["toastr","angularUtils.directives.dirPagination"]);
joelmodule.controller("JoelController", function($scope,$http, toastr,$timeout) {
     
toastr.success('Hello world!', 'Toastr fun!');

/*define functions*/
$scope.myfunctionname = function (){
alert('my first function');
}

});


joelmodule.config(function(paginationTemplateProvider) {
    
    setTimeout(function(){ paginationTemplateProvider.setPath('dirPagination.tpl.html'); }, 3000);
    
});


Here is the full explanation for pagination 
https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination

View his Video for full understanding




Apart from this I have even added Toaster for messages


Make sure to download the files in the correct location ie dirPagination.tpl.html should be placed in the same folder as the html file as per the above example..Comment below if you still have doubts..

I hope that this tutorial was useful to you...


Angular JavaScript Tutorial Series - Soon to be Launched!





Dear Guys!...Welcome to my website ! :D I will soon be launching my own tutorial series after a few weeks where I will post one video Daily for 30 days!



In the Videos I will teach you about the basic concepts to learn Angular Js and JavaScript.

I will show you as I create small Examples



Subscribe to my channel to stay tuned https://www.youtube.com/channel/UCEgvqqQgOteLU9OgTho8_Wg

Improve Sound Quality in Adobe Premier Pro (Vocal Enhancer in Premiere Pro)





Dear Guys I have created this video to show you how I applied the effects that are the De hummer ,the  De Noise and Equalizer Effects in Adobe Premier.Fiddle with the settings as shown and preview untill you get the best sound output :)

Adobe Premier Pro is the Best software to edit your Videos.

Making these changes where quiet easy when using adobe premier pro



Subscribe to my channel http://www.youtube.com/subscription_c...

Php Code to send Push Notifications



Hey Guys Below is the code to help you send Push Notifications to your mobile app from your website (php server)

You will need to pass the device id in the url

For Example http://yourwebsite.com/sendpushnotification.php?id=placedeviceuniqueidhere


Below is the sendpushnotification.php you will need to put in your Google Api key on the line  $apiKey = 'yourapikeyhere'.You will get it form the Google Developer Console.

<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );


echo $_GET['id'];
$registrationIds = array( $_GET['id'] );//


// prep the bundle
$msg = array
(
'message' => 'here is a message. message',
'title' => 'This is a title. title',
'subtitle' => 'This is a subtitle. subtitle',
'tickerText' => 'Ticker text here...Ticker text here...Ticker text here',
'vibrate' => 1,
'sound' => 1,
'largeIcon' => 'large_icon',
'smallIcon' => 'small_icon'
);
$fields = array
(
'registration_ids' => array($registrationIds),
'data' => $msg
);

$headers = array
(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);

$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
curl_setopt( $ch,CURLOPT_POST, true );
curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
$result = curl_exec($ch );
curl_close( $ch );
echo $result;

Comment Below if you have Doubts or Questions

How to Update Version Cordova PhoneGap App?




Dear Guys,Joel here from JoelWebsites.com :D in this small post I show you how to update your cordova app version
So how is this tutorial Going to be useful?
When uploading apps this happens during updating the existing app on the playstore we get an error that we need to update the Android Version for the app.

So it is really difficult to update the Version if you do not know what are the steps to done.
After lot of searching online.I finally found the solution.

We need to add android-versionCode="yourappversion" to the config.xml file like below.

Your widget tag code should look like below in the config.xml

Here is just an example

<widget android-versionCode="7" id="com.yourapp.YourApp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

You will find the config file in the following directories in your project folder.I made changes in all the config.xml files to make things simpler.





Later on you will see the manifest file updated like below after the build the android project
Your App directory/platforms/android/AndroidManifest.xml

<manifest android:versionCode="7" android:hardwareAccelerated="true" android:versionName="0.0.1" package="com.yourapp.Yourapp" xmlns:android="http://schemas.android.com/apk/res/android">


if android:versionCode is not available then you will need to add it like shown above.

Moreover , Google playstore may say that the version you need should be greater than 10 whereas you would see it to be set as 1 in your AndroidManifest.xml .So do not worry just increase the number and the rebuild the app and you should be fine...View the other article on how to sign and align the apk file for the playstore here

So once again here is the Golden code to change the app version for your Cordova PhoneGap Project in config.xml

<widget android-versionCode="AppVersion" id="com.yourapp.YourApp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


So I hope that this tutorial was useful do comment below if you have doubts or questions,Thank you

Check my youtube channel here