Sunday, 13 June 2021

Format Date ( ) JS Functionalities

 https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date

Thursday, 10 June 2021

Install Chocolatey and Update node.js

 https://docs.chocolatey.org/en-us/choco/setup

choco install python
choco upgrade chocolatey

Wednesday, 2 June 2021

Session (Native Php)

Maybe depending on PHP settings, but if return values are not the above, then go for this:
_DISABLED = 0
_NONE = 1
_ACTIVE = 2



Universal function for checking session status.

start session

<?php
/**
* @return bool
*/

function is_session_started()
{
    if ( 
php_sapi_name() !== 'cli' ) {
        if ( 
version_compare(phpversion(), '5.4.0''>=') ) {
            return 
session_status() === PHP_SESSION_ACTIVE TRUE FALSE;
        } else {
            return 
session_id() === '' FALSE TRUE;
        }
    }
    return 
FALSE;
}

// Example
if ( is_session_started() === FALSE session_start();
?>


Unset

<?php
// remove all session variables
session_unset();


Destroy

// destroy the session
session_destroy();
?>


Notes

As a shorthand you can use
@session_start()
with the @ at the beginning to suppress the
PHP notice "A session had already been started - ignoring session_start()"

As stated in the manual for session_start(), a second call will do no harm,
it will be simply ignored. But you need the @, if you don't want to get the notice.

Put Cookie in prestashop 1.5 and 1.6

 Today I will show you how can you simple set and get your custom cookie variable.

It is useful when you want to keep locally on user’s PC some settings.

Setting cookie

$this->context->cookie->__set('your_cookie_name', 'your cookie value');
$this->context->cookie->write();

Getting cookie

$this->context->cookie->__get('your_cookie_name');

Check if cookie exists

$this->context->cookie->__isset('your_cookie_name');

Deleting cookie

$this->context->cookie->__unset('your_cookie_name');

Final words

Remember – if you don’t have access to $this->context, you can replace it with Context::getContext().

That’s all – as simple as that!


Reference Tutorial

https://prestacraft.com/tutorials/

Put Cookie in prestashop 1.5 and 1.6

 


Tuesday, 1 June 2021

array shift after export pdf array (col header, value row)

 Shift off the first item to get the keys:

$keys = array_shift($array);

Then map array_combine over the rest of it using the array of keys.

$result = array_map(function($values) use ($keys) {
    return array_combine($keys, $values); }, $array);

Based on the code shown in your edit, it looks like you could actually do this as you build the array instead if you replace $rows[] = $cells; with:

if (isset($keys)) {
$rows[] = array_combine($keys, $cells);
} else {
$keys = $cells;
}

Saturday, 29 May 2021

Ionic Platform Add Android

 installing & building ionic platform android (build apk)


https://wakeupcoders.medium.com/how-to-make-a-apk-file-from-ionic-project-9be865f19846