Friday, March 13, 2015

How to date format change using PHP

I am working in php application. I want to change date format in my application I want to show the date like "Friday March 13, 2015".

The global "Standard" is yyyy-mm-dd, and should always be used by systems wherever possible. The order day, month, year is used by people in most of the world (except USA), but usually with slashes, not hyphens. To avoid confusion, I only separate YYYY-MM-DD with hyphens. Any other date format I will separate with slashes

I just simply change my php date format the follow mentioned below:

<?php echo date('l F d,Y',strtotime($row['created_date'])); ?>

how to create stored procedure for Select the single table values

I am working in php application. I want to get the events from my_events table. Simply i wrote the select query using stored procedure.

It's just easy to implement in my php application for application performace to increse.

DELIMITER $$

CREATE PROCEDURE `myporject_events`()

BEGIN
 SELECT * FROM my_events WHERE events_status="1" ORDER BY events_id DESC LIMIT 5;
END$$

DELIMITER ;

Friday, March 6, 2015

PhoneGap / Cordova using Get unique device id (UUID)

I am working in phonegap application. I want to do get uniqueDeviceId using Phonegap. first of all I used cordova device plugin for get uuid while i got a problem when I generate new build the uuid has been changed. So after that I found new plugin for get mobile UniqueDeviceId.

I found this plugin :-

It's just easy to add and implement click the following link to get UniqueDeviceId.

Step:1


phonegap local plugin add hu.dpal.phonegap.plugins.uniquedeviceid

(or) 

cordova plugin add hu.dpal.phonegap.plugins.uniquedeviceid



Step:2
Usage:
// Get UUID

window.plugins.uniqueDeviceID.get(success, fail);



Step:4
Success function callback

function success(uuid)
{
    console.log(uuid);
};

functionfail(e)
{

    console.log(e);

};

Wednesday, March 4, 2015

Enable iPhone Location Services using Confirmation Settings alert Message in phonegap

I am working in phonegap application. I want to track the user using GPS lat long based. If there is GPS Setting Disabled. What I want to do is provide a link from the App to “Settings - > Location Services"


navigator.notification.confirm(
                                   'Oops! Failed to Location services to BOSS system, Check your GPS connection ?',  // message
                                   onConfirmGPS,              // callback to invoke with index of button pressed
                                   'Enable GPS Settings',            // title
                                   'Settings,Cancel'          // buttonLabels
                                   );


Edit: you should also be able to specify where in the settings application by using that type of URL, just to clarify.



function onConfirmGPS(buttonIndex)
{
    if(buttonIndex==1)
    {
        window.location="prefs:root=LOCATION_SERVICES;

        }

}


Follow the above procedure for GPS settings in Phonegap. Similarly follow the same procedure for other URL settings provided blow.

prefs:root=General&path=About
prefs:root=General&path=ACCESSIBILITY
prefs:root=AIRPLANE_MODE
prefs:root=General&path=AUTOLOCK
prefs:root=General&path=USAGE/CELLULAR_USAGE
prefs:root=Brightness
prefs:root=General&path=Bluetooth
prefs:root=General&path=DATE_AND_TIME
prefs:root=FACETIME
prefs:root=General
prefs:root=General&path=Keyboard
prefs:root=CASTLE
prefs:root=CASTLE&path=STORAGE_AND_BACKUP
prefs:root=General&path=INTERNATIONAL
prefs:root=LOCATION_SERVICES
prefs:root=ACCOUNT_SETTINGS
prefs:root=MUSIC
prefs:root=MUSIC&path=EQ
prefs:root=MUSIC&path=VolumeLimit
prefs:root=General&path=Network
prefs:root=NIKE_PLUS_IPOD
prefs:root=NOTES
prefs:root=NOTIFICATIONS_ID
prefs:root=Phone
prefs:root=Photos
prefs:root=General&path=ManagedConfigurationList
prefs:root=General&path=Reset
prefs:root=Sounds&path=Ringtone
prefs:root=Safari
prefs:root=General&path=Assistant
prefs:root=Sounds
prefs:root=General&path=SOFTWARE_UPDATE_LINK
prefs:root=STORE
prefs:root=TWITTER
prefs:root=General&path=USAGE
prefs:root=VIDEO
prefs:root=General&path=Network/VPN
prefs:root=Wallpaper
prefs:root=WIFI
prefs:root=INTERNET_TETHERING