SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Shaydez's Avatar
    Join Date
    Jul 2006
    Location
    Boca Raton, Florida
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Insert Dynamic Array

    I'm working on docusign app, and if I have 1 Signer it'll fill in the signing array if i have 2 signers it'll add extra signer array. However i can't add If $secondsigner put array here inside the array. I also tried

    if secondsigner 'array(infostuff)'; didn't work well

    how i can i add the array inside the array?

    Code:
    "recipients" => array( "signers" => array(
    
    						array( "email" => $sh1_email,
    						"name" => $sh1_name,
    						"recipientId" => "1",
    						"tabs" => array(
    
    						"initialHereTabs" => array(
    						array(
    						"xPosition" => "480",
    						"yPosition" => "130",
    						"documentId" => "1",
    						"pageNumber" => "1"
    						),
    						array(
    						"xPosition" => "480",
    						"yPosition" => "760",
    						"documentId" => "1",
    						"pageNumber" => "1"
    						),
    						array(
    						"xPosition" => "480",
    						"yPosition" => "760",
    						"documentId" => "1",
    						"pageNumber" => "2"
    						),
    						array(
    						"xPosition" => "480",
    						"yPosition" => "760",
    						"documentId" => "1",
    						"pageNumber" => "3"
    						)
    						
    					),
    					"signHereTabs" => array(
    						array(
    						"xPosition" => "100",
    						"yPosition" => "350",
    						"documentId" => "1",
    						"pageNumber" => "3"
    						),
    						array(
    						"xPosition" => "100",
    						"yPosition" => "520",
    						"documentId" => "1",
    						"pageNumber" => "3"
    						),
    						array(
    						"xPosition" => "80",
    						"yPosition" => "620",
    						"documentId" => "1",
    						"pageNumber" => "4"
    						)
    						)
    					
    				)
    			)
    						
    
    /* Start Additional Signer Here */						
    
    ,                                       array("email" => $sh2_email,
    						"name" => $sh2_name,
    						"recipientId" => "2",
    						"tabs" => array(
    
    						"initialHereTabs" => array(
    						array(
    						"xPosition" => "530",
    						"yPosition" => "130",
    						"documentId" => "1",
    						"pageNumber" => "1"
    						),
    						array(
    						"xPosition" => "530",
    						"yPosition" => "760",
    						"documentId" => "1",
    						"pageNumber" => "1"
    						),
    						array(
    						"xPosition" => "530",
    						"yPosition" => "760",
    						"documentId" => "1",
    						"pageNumber" => "2"
    						),
    						array(
    						"xPosition" => "530",
    						"yPosition" => "760",
    						"documentId" => "1",
    						"pageNumber" => "3"
    						)
    						
    					),
    					"signHereTabs" => array(
    						array(
    						"xPosition" => "100",
    						"yPosition" => "395",
    						"documentId" => "1",
    						"pageNumber" => "3"
    						),
    						array(
    						"xPosition" => "100",
    						"yPosition" => "565",
    						"documentId" => "1",
    						"pageNumber" => "3"
    						)
    						)
    				
    )				)
    
    /* end Second Additional Signer Here */						
    
    			)
    
    
    ),
    Sr. Website Developer and Internet Marketing
    www.CarlosJa.com Note: If anyone
    needs to get ahold of me please feel free to email me through
    my site. Apparently i missed quite a few private messages.

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    I feel like i've come into the middle of a conversation...

    How is this data being fed in?

    The normal syntax is just $array['recipients']['signers'][] = $newarray; ...
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    SitePoint Addict Shaydez's Avatar
    Join Date
    Jul 2006
    Location
    Boca Raton, Florida
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The Array is fed in exactly as you how see it. I'll post the PHP Code ..

    Second Signer is optional and is based if there's a second signer in the database.

    so i was trying to do

    if($signer2) { // then put signer array here }

    but the array value are preset, as they're (x/y) coordinates for the Initial and Signing Tabs for DocuSign.

    PHP Code:
    $data = array (
    "emailBlurb" => "Please review agreement.",
    "emailSubject" => "DocuSign Agreement",
    "documents" => array(array( "documentId" => "1""name" => "NameofPDF.pdf")),
    "recipients" => array( "signers" => array(

                            array( 
    "email" => 'signer@email.com',
                            
    "name" => 'My Name',
                            
    "recipientId" => "1",
                            
    "tabs" => array(

                            
    "initialHereTabs" => array(
                            array(
                            
    "xPosition" => "480",
                            
    "yPosition" => "130",
                            
    "documentId" => "1",
                            
    "pageNumber" => "1"
                            
    ),
                            array(
                            
    "xPosition" => "480",
                            
    "yPosition" => "760",
                            
    "documentId" => "1",
                            
    "pageNumber" => "1"
                            
    ),
                            array(
                            
    "xPosition" => "480",
                            
    "yPosition" => "760",
                            
    "documentId" => "1",
                            
    "pageNumber" => "2"
                            
    ),
                            array(
                            
    "xPosition" => "480",
                            
    "yPosition" => "760",
                            
    "documentId" => "1",
                            
    "pageNumber" => "3"
                            
    )
                            
                        ),
                        
    "signHereTabs" => array(
                            array(
                            
    "xPosition" => "100",
                            
    "yPosition" => "350",
                            
    "documentId" => "1",
                            
    "pageNumber" => "3"
                            
    ),
                            array(
                            
    "xPosition" => "100",
                            
    "yPosition" => "520",
                            
    "documentId" => "1",
                            
    "pageNumber" => "3"
                            
    ),
                            array(
                            
    "xPosition" => "80",
                            
    "yPosition" => "620",
                            
    "documentId" => "1",
                            
    "pageNumber" => "4"
                            
    )
                            )
                        
                    )
                )
                            

    /* Start Additional Signer Here */                        

    ,
                        array(
    "email" => 'signer2@email.com',
                            
    "name" => 'signer 2 name',
                            
    "recipientId" => "2",
                            
    "tabs" => array(

                            
    "initialHereTabs" => array(
                            array(
                            
    "xPosition" => "530",
                            
    "yPosition" => "130",
                            
    "documentId" => "1",
                            
    "pageNumber" => "1"
                            
    ),
                            array(
                            
    "xPosition" => "530",
                            
    "yPosition" => "760",
                            
    "documentId" => "1",
                            
    "pageNumber" => "1"
                            
    ),
                            array(
                            
    "xPosition" => "530",
                            
    "yPosition" => "760",
                            
    "documentId" => "1",
                            
    "pageNumber" => "2"
                            
    ),
                            array(
                            
    "xPosition" => "530",
                            
    "yPosition" => "760",
                            
    "documentId" => "1",
                            
    "pageNumber" => "3"
                            
    )
                            
                        ),
                        
    "signHereTabs" => array(
                            array(
                            
    "xPosition" => "100",
                            
    "yPosition" => "395",
                            
    "documentId" => "1",
                            
    "pageNumber" => "3"
                            
    ),
                            array(
                            
    "xPosition" => "100",
                            
    "yPosition" => "565",
                            
    "documentId" => "1",
                            
    "pageNumber" => "3"
                            
    )
                            )
                    
    )                )

    /* end Second Additional Signer Here */                        

                
    )


    ),
    "status" => "sent");

    print_r($data); 
    Sr. Website Developer and Internet Marketing
    www.CarlosJa.com Note: If anyone
    needs to get ahold of me please feel free to email me through
    my site. Apparently i missed quite a few private messages.

  4. #4
    SitePoint Addict Shaydez's Avatar
    Join Date
    Jul 2006
    Location
    Boca Raton, Florida
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help.. i figured it out.. I was over complicating the issue.
    Sr. Website Developer and Internet Marketing
    www.CarlosJa.com Note: If anyone
    needs to get ahold of me please feel free to email me through
    my site. Apparently i missed quite a few private messages.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •