Follow Me:

Monday 3 February 2014

    By using array_diff() function , we can remove the array values in php
    <?php

   <?php
       $arr_remove = array('Codingslover', 'webslessons', 'meetcity', 
       'eshopoffers','google'); $arr = array_diff($arr_remove, array('webslessons', 'google')); echo "<pre>";print_r($arr_remove); echo "<pre>";print_r($arr); ?>

Monday 11 February 2013

FedEx Web Services is the next generation API for integrating software applications with FedEx Systems. Web services represent the future application integration because they offer the following:
  • Inter-operability: Any Web service can interact with any other Web service and can be written in any language.
  • Ubiquity: Web services communicate using HTTP and XML--So any connected device that supports these technologies can both host and access Web Services.
  • Low Barrier to Entry: The concepts behind Web services are easy to understand, and developers can quickly create and deploy them using many tool-kits available on the web.
  • Industry Support: Major content providers and vendors are supporting the Web services movement.



View the Demo

Fedex Shipping Integration For International priority

The international priority for FedEx Shipping Codes is given below:
Codings:

<?php

// Copyright 2009, FedEx Corporation. All rights reserved.
// Version 12.0.0
require_once('../../../library/fedex-common.php5');
//The WSDL is not included with the sample code.
//Please include and reference in $path_to_wsdl variable.
$path_to_wsdl = "../../../wsdl/ShipService_v12.wsdl";


// PDF label file. Change to file-extension .pdf for creating a PDF label
define('SHIP_LABEL', 'shipexpresslabel.pdf');  
ini_set("soap.wsdl_cache_enabled", "0");

// Refer to http://us3.php.net/manual/en/ref.soap.php for more information
$client = new SoapClient($path_to_wsdl, array('trace' => 1)); 

$request['WebAuthenticationDetail'] = array(
 'UserCredential' =>array(
 'Key' => getProperty('key'), 
 'Password' => getProperty('password')
 )
);

$request['ClientDetail'] = array(
 'AccountNumber' => getProperty('shipaccount'), 
 'MeterNumber' => getProperty('meter')
);

$request['TransactionDetail'] = array('CustomerTransactionId' => '
*** Express International Shipping Request v12 using PHP ***');
$request['Version'] = array(
 'ServiceId' => 'ship', 
 'Major' => '12', 
 'Intermediate' => '1', 
 'Minor' => '0'
);

$request['RequestedShipment'] = array(
 'ShipTimestamp' => date('c'),
 'DropoffType' => 'REGULAR_PICKUP',
 'ServiceType' => 'INTERNATIONAL_PRIORITY', 
 'PackagingType' => 'YOUR_PACKAGING', 
 'Shipper' => addShipper(),
 'Recipient' => addRecipient(),
 'ShippingChargesPayment' => addShippingChargesPayment(),
 'CustomsClearanceDetail' => addCustomClearanceDetail(),                                                                                                       
 'LabelSpecification' => addLabelSpecification(),
 'CustomerSpecifiedDetail' => array(
  'MaskedData'=> 'SHIPPER_ACCOUNT_NUMBER'
 ), 
 'RateRequestTypes' => array('ACCOUNT'), // valid values ACCOUNT and LIST
 'PackageCount' => 1,
 'RequestedPackageLineItems' => array(
  '0' => addPackageLineItem1()
 ),
 'CustomerReferences' => array(
  '0' => array(
   'CustomerReferenceType' => 'CUSTOMER_REFERENCE', 
   'Value' => 'TC007_07_PT1_ST01_PK01_SNDUS_RCPCA_POS'
  )
 )
);

try
{
 if(setEndpoint('changeEndpoint'))
 {
  $newLocation = $client->__setLocation(setEndpoint('endpoint'));
 }
 // FedEx web service invocation
 $response = $client->processShipment($request); 
 if($response->HighestSeverity 
!= 'FAILURE' && $response->HighestSeverity != 'ERROR')
 {
  printSuccess($client, $response);
  // Create PNG or PDF label
  // Set LabelSpecification.ImageType to 'PDF' for generating a PDF label
  $fp = fopen(SHIP_LABEL, 'wb');   
  fwrite($fp, ($response->CompletedShipmentDetail->CompletedPackageDetails
->Label->Parts->Image));
  fclose($fp);
  echo 'Label <a href="./'.SHIP_LABEL.'">'.SHIP_LABEL.'</a> was generated.';            
 }
 else
 {
  printError($client, $response);
 }
 writeToLog($client);    // Write to log file
} catch (SoapFault $exception) {
 printFault($exception, $client);
}

function addShipper(){
 $shipper = array(
  'Contact' => array(
   'PersonName' => 'Sender Name',
   'CompanyName' => 'Sender Company Name',
   'PhoneNumber' => '1234567890'
  ),
  'Address' => array(
   'StreetLines' => array('Address Line 1'),
   'City' => 'Austin',
   'StateOrProvinceCode' => 'TX',
   'PostalCode' => '73301',
   'CountryCode' => 'US'
  )
 );
 return $shipper;
}

function addRecipient(){
 $recipient = array(
  'Contact' => array(
   'PersonName' => 'Recipient Name',
   'CompanyName' => 'Company Name',
   'PhoneNumber' => '1234567890'
  ),
  'Address' => array(
   'StreetLines' => array('Address Line 1'),
   'City' => 'Richmond',
   'StateOrProvinceCode' => 'BC',
   'PostalCode' => 'V7C4V4',
   'CountryCode' => 'CA',
   'Residential' => false
  )
 );
 return $recipient;                                    
}

function addShippingChargesPayment(){
 $shippingChargesPayment = array(
  'PaymentType' => 'SENDER',
  'Payor' => array(
   'ResponsibleParty' => array(
    'AccountNumber' => getProperty('billaccount'),
    'Contact' => null,
    'Address' => array('CountryCode' => 'US')
   )
  )
 );
 return $shippingChargesPayment;
}

function addLabelSpecification(){
 $labelSpecification = array(
  'LabelFormatType' => 'COMMON2D', // valid values COMMON2D, LABEL_DATA_ONLY
  'ImageType' => 'PDF',  // valid values DPL, EPL2, PDF, ZPLII and PNG
  'LabelStockType' => 'PAPER_7X4.75');
 return $labelSpecification;
}

function addSpecialServices(){
 $specialServices = array(
  'SpecialServiceTypes' => array('COD'),
  'CodDetail' => array(
  'CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150),
  'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS
 );
 return $specialServices; 
}

function addCustomClearanceDetail(){
 $customerClearanceDetail = array(
  'DutiesPayment' => array(
   'PaymentType' => 'SENDER', //valid values RECIPIENT,SENDER and THIRD_PARTY
   'Payor' => array(
    'ResponsibleParty' => array(
     'AccountNumber' => getProperty('dutyaccount'),
     'Contact' => null,
     'Address' => array('CountryCode' => 'US')
    )
   )
  ),
  'DocumentContent' => 'NON_DOCUMENTS',                                                                                            
  'CustomsValue' => array(
   'Currency' => 'USD', 
   'Amount' => 100.0
  ),
  'Commodities' => array(
   '0' => array(
    'NumberOfPieces' => 1,
    'Description' => 'Books',
    'CountryOfManufacture' => 'US',
    'Weight' => array(
     'Units' => 'LB', 
     'Value' => 1.0
    ),
    'Quantity' => 4,
    'QuantityUnits' => 'EA',
    'UnitPrice' => array(
     'Currency' => 'USD', 
     'Amount' => 100.000000
    ),
    'CustomsValue' => array(
     'Currency' => 'USD', 
     'Amount' => 400.000000
    )
   )
  ),
  'ExportDetail' => array(
   'B13AFilingOption' => 'NOT_REQUIRED'
  )
 );
 return $customerClearanceDetail;
}

function addPackageLineItem1(){
 $packageLineItem = array(
  'SequenceNumber'=>1,
  'GroupPackageCount'=>1,
  'Weight' => array(
  'Value' => 20.0,
  'Units' => 'LB'),
  'Dimensions' => array(
  'Length' => 20,
  'Width' => 20,
  'Height' => 10,
  'Units' => 'IN')
 );
 return $packageLineItem;
}
?>

Download the below Documents:

FedEx Intergrations Codings

More link:

http://www.codingslover.com/search/label/Api%20Integration



Wednesday 21 November 2012

How do you disable "Save as" function on images?

    I want to the disable the save option in image and also disable copy the image  script will be given below:
 
 <style>
thumbnail.large,thumbnail.large .box-crop,thumbnail.large .box-contests,thumbnail.large .details,thumbnail.large .details .relative {width:100%;height:100%;}
thumbnail .details,thumbnail .details .relative {width:100%;height:100%;box-shadow:0;}
thumbnail .details .top .content {min-height:30px;}
thumbnail .details .top {display:block;font-size:16px;line-height:28px;text-align:center;}
thumbnail a:hover {text-decoration:none;}
thumbnail .details .top,thumbnail .details .bottom {width:100%;color:white;}
thumbnail .details .bottom {line-height:24px;}
thumbnail .closed .details .bottom.content {background:#D70200;text-align:center;line-height:26px;}
thumbnail .box-crop.crop-height img {width:100%;height:auto;margin-left:auto;}
thumbnail .details {position:absolute;top:0;left:0;}
</style>


<thumbnail class="large">
<img src="./images/pair.jpg" alt="Pair">
<a href="#"><div class="details"></div></a>
</thumbnail>

Download the Link:

https://www.box.com/shared/6rznbxxyt2fm956kgvao

The following file will be working fine.

Wednesday 7 November 2012

How to disable "Save as" in an Adobe PDF document

Embeddable Google Document Viewer

Google Docs offers an undocumented feature that lets you embed PDF files and PowerPoint presentations in a web page. The files don't have to be uploaded to Google Docs, but they need to be available online.

<iframe src="http://docs.google.com/gview?url=onlinebetaversion.com/icdipl/images/RINA_Certificate.pdf&embedded=true" style="width:620px;height:800px;border:none;"  frameborder="0"></iframe>

 but you should replace the bold URL with your own address. As I mentioned, the document viewer works for PDF and PPT files.

 Example:

http://onlinebetaversion.com/icdipl/certificate.php