Skip to content

Instantly share code, notes, and snippets.

// THIS IS THE HTML FOR THE BUTTON CLIENT DELETE BUTTON
// onclick note: it is important we return the value of the confirmation to the form from the button
<button name='del' value='<?= $id ?>' onclick='return deleteClient("<?= $entreprise ?>")'>Delete</button>
// THIS IS THE JAVASCRIPT FUNCTION
function deleteClient(btn, clientName){
<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=4)</i>
0 <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=2)</i>
'driver_id' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'1'</font> <i>(length=1)</i>
'fname' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'Luke'</font> <i>(length=4)</i>
1 <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=2)</i>
'driver_id' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'2'</font> <i>(length=1)</i>
'fname' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'James'</font> <i>(length=5)</i>
$(document).ready(function(){
onload();
$(window).bind('resize', adjustContentLayout);
});
//window.addEventListener('load', onload, false);
//window.addEventListener('resize', adjustContentLayout, false);
function onload(){
// jquery plugin attempt.
// problem: sessionActive() issues an jquery post call, i wanted sessionActive() to return the response but only way is to sync the request. how do you suggest a work around without cluttering jquery or should i just turn the request type to sync ??
if( ! document.hasFocus() && methods.sessionActive() ) data.timeInactive = 0 ;
else methods.showWarning();
// Javascript
$this.data('session',{
timer : null // javascript interval timer
, timeInactive: 0 // time spent inactive
, warning : {} // warning object
});
data = $this.data('session');
<?php
class singleton {
protected static $instance;
private function __construct(){}
private function __clone(){}
static public function load(){
if(!self::$instance) return new singleton();