Tuesday, March 20, 2018

PHP remove useless zero from decimal and number format




1) PHP remove useless zero from decimal
 floatval(1.0);
return 1
2) number format
number_format(100.23, 1','' ');
  return 100.2
3) return integer part
intval(4.2);
return 4

Saturday, March 17, 2018

deposit cheque in TD bank using Mobile phone




Deposit cheque in  TD bank using Mobile phone. I try once ad success and found it is pretty easy and I don not need to walk to bank machine to deposit my check.
1) Download TD App
2) login TD account and  click deposit
3) Take a photo of the front and back of the completed cheque. Make sure the frame shown in
Mobile match check frame.
4) Submit
5) Click Deposit button in TD App again to view Mobile deposit history

How to connect iPhone 5 to Windows 10 PC





I can not see my iPhone   5 when I connect to Windows 10 PC, which worked before.
I realize I need to download iTunes
1) Go to www.apple.com/itunes
2) Download iTunes6464Setup.exe installer and install
3) restart PC.
4) Connect iPhone to PC
  1. Trust this Computer? will appear on your iPhone. Click Trust.
  2. 'Do you want this computer to access your iPhone?' will appear in Windows. Click Continue.
5) open iTune
6) Click on Device in iTunes and choose your iPhone
7) You can back up or Sync iPhone  to Windows 10,but only for audio files
But at least I can see my iPhone icon in PC and delete video files or copy videos files

Friday, March 2, 2018

Undefined Values in JS is not posted In AJAX Requests





In following JS code
function saveLTDrowConv(parent){
                pad_id =$('select[name="department1"] option:selected').val();
                 year =$('select[name="ReviewYear"] option:selected').val();
                 Deanrecommd = parent.find('.term_CONV_Dean').val();
                 conv  = parent.find('.term_CONV').val();
                 fte = parent.find('.term_CONV_fte').val();
                 sfu_id  = parent.find('.sfuid').html();
                 var filter = {

                        "pad_id":pad_id,
                        "year":year,
                        "sfu_id":sfu_id,
                        "fte":fte,
                        "Deanrecommd":Deanrecommd,
                        "conv":conv

                }
                 parent.find('.ltd_CONV_row').attr('disabled','disabled');
                 $.post("/tracs/ajax/facultyHiringPlan_ajax/saveLTDrowConv",  {"post":filter
                        }, function(data) {
                 
                        parent.find('.ltd_CONV_row').removeAttr('disabled');

                        $("div#notice").html('Update successfully.');
                        $("div#notice").css('display', 'block');
                        $("div#notice").fadeOut(5000);  


                });
}

If  Deanrecommd is undefined and  we post Deanrecommd, the server will not receive
Deanrecommd. i.e no $post['Deanrecommd']  in server. So as to other post variables.