Wednesday 5 June 2019

Resignation Mail Sample 1

Resignation Mail Sample 1
Dear Sir,

Please accept this as my formal resignation letter from my position as
a [POSITION] to be effective from [DATE of Resignation].
I wish to thank you and all my colleagues at (XXX) for all your help,

professional courtesy, and support. I have immensely enjoyed working
here as the [POSITION] for the [XXX] years, and my experience with
this company has been greatly rewarding.

I wish you and the rest of the team continued success, and I want to
take this opportunity again to thank you for permitting me to be part
of the team.

Sincerely,
[Name]

Resignation Mail Sample 2

Dear Sir,

Please accept this as my formal resignation letter from my position as
a [POSITION] to be effective from [DATE of Resignation].

I wish to thank you and all my colleagues at [CompanyName] for all your help,
professional courtesy, and support. I have immensely enjoyed working
here as the [POSITION] for the [XXX] years, and my experience with
this company has been greatly rewarding.

I wish you and the rest of the team continued success, and I want to
take this opportunity again to thank you for permitting me to be part
of the team.

Sincerely,
[Name]

Friday 25 August 2017

Smooth Scroll to div Sticky header

Smooth Scroll to div

    var hash = "#block-block-33";
    jQuery('html, body').animate({
        scrollTop: jQuery(hash).offset().top-300
       }, 800, function(){

         // Add hash (#) to URL when done scrolling (default click behavior)
         //window.location.hash = hash;
         var a=jQuery(hash).offset().top-190;


         //jQuery('.search-icon').text(a);


        window.scrollTo(0,a);
    });

Thursday 10 August 2017

Post image without form using ajax



<!DOCTYPE html>
<html>
   <head>
      <script src="jquery.min.js"></script>
   </head>
   <body>
      <form method="post" action="upload.php" enctype="multipart/form-data">
         <input type="file" name="fileToUpload" id="fileToUpload" >
         <p class="upload-it">Upload this</p>
         <input type="submit" name="upload" value="Go" >
      </form>
      <?php
         $target_dir = "uploads/";
         $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
         $uploadOk = 1;
         $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
         // Check if image file is a actual image or fake image
         if(isset($_POST["upload"])) {
             $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
             if($check !== false) {
                 if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
                     echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
                 } else {
                     echo "Sorry, there was an error uploading your file.";
                 }
                 echo "File is an image - " . $check["mime"] . ".";
                 $uploadOk = 1;
             } else {
                 echo "File is not an image.";
                 $uploadOk = 0;
             }
         }
         ?>
      <script>
         $(function(){
             $(document).on("click", ".upload-it", function() {
                 var file_data = $("#fileToUpload").prop("files")[0];  
                 var form_data = new FormData();                 
                 form_data.append("fileToUpload", file_data);    
                 form_data.append("upload", "upload");           
                 $.ajax({
                             url: "upload.php",
                             dataType: 'script',
                             cache: false,
                             contentType: false,
                             processData: false,
                             data: form_data,                    
                             type: 'post'
                    })
             })
         })
        
      </script>
   </body>
</html>


Wednesday 9 August 2017

Using Curl


$ch = curl_init();        // initialize curl
curl_setopt($ch, CURLOPT_URL,"http://mobilemonitoring.compliantcampaign.com/api/user/create");        //setting url
curl_setopt($ch, CURLOPT_POST, 1);
$vars=array("name"=>"testrah","password"=>"123456");    //setting post variables
curl_setopt($ch, CURLOPT_POSTFIELDS,$vars);  //Posting Fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);   

$headers = ['Auth: 2309usdfoasep0qu234asdf1'];    // setting authentication in header

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);    // setting authentication in header in curl   

$server_output = curl_exec ($ch);    // executing curl

curl_close ($ch);        // closing curl;

print  $server_output ;


Wednesday 26 July 2017

How to print using jquery


Simply just add print.js Library and configure as

JQuery:

    jQuery(".print-button a").on('click', function() {
                  
        jQuery(this).parent().find('.maincontainertoprint').print({

            globalStyles : true,
            mediaPrint : true,
            stylesheet : 'yourstyle.css',
            iframe : false,
            noPrintSelector : ".button, .printbtn",
            deferred: jQuery.Deferred().done(function() { console.log('Printing done', arguments); })
        });
    });


Html:


<div class="maincontainer">
    <div class="print-button">
        <a href="javascript:void(0)" class="">Print</a>
    </div>
    <div class="maincontainertoprint">
        <table>
            <tr>
                <th>S.No.</th>
                <th>Name</th>
                <th>Email</th>
            </tr>
            <tr>
                <td>1</td>
                <td>Bharat</td>
                <td>bharat@gmail.com</td>
            </tr>
            <tr>
                <td>2</td>
                <td>Ravi</td>
                <td>ravi@gmail.com</td>
            </tr>
            <tr>
                <td>3</td>
                <td>Ajay</td>
                <td>ajay@gmail.com</td>
            </tr>
            <tr>
                <td>4</td>
                <td>Gagan</td>
                <td>gagam@gmail.com</td>
            </tr>
        </table>
    </div>
</div>

Library

Monday 17 July 2017

How to hide date picker on button click

How to hide date picker on button click

#ui-datepicker-div is parent div in which calendar is shown
<input type="button" id="edit-field-date-value-value-datepicker-popup-1" value="close" onclick="return dtPickerClose()" />

function dtPickerClose(){
    jQuery('#ui-datepicker-div').hide();
    jQuery("#edit-field-date-value-value-datepicker-popup-1").attr("class","");
}

this also work in drupal