Advertisement
Guest User

PHPRtfLite

a guest
Sep 21st, 2011
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 13.65 KB | None | 0 0
  1.         /***************STARTING INCORPORATION FORMS**************************/
  2.        
  3.        
  4.         $sect = $rtf->addSection();
  5.        
  6.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER);
  7.         $sect->writeText('<b><u>PRIVATE LIMITED COMPANY INCORPORATION<br>The Companies Act (Chapter 50)<br></u></b>', $font, $parFormat);
  8.         $sect->writeText('<br>', $font);
  9.        
  10.        
  11.         $font = new PHPRtfLite_Font(8);
  12.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_RIGHT);
  13.         $sect->writeText('<i>For the purpose of E-filing</i><br>', $font, $parFormat);
  14.        
  15.         $font = new PHPRtfLite_Font(10);
  16.        
  17.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER);
  18.        
  19.         $table = $sect->addTable(PHPRtfLite_Table::ALIGN_CENTER);
  20.         $table->addRow(1);
  21.         $table->addRow(1);
  22.         $table->addRow(1);
  23.         $table->addRow(1);
  24.         $table->addRow(1);
  25.         $table->addRow(1);
  26.         $table->addRow(1);
  27.         $table->addColumnsList(array(8,9.5));
  28.         //Merge the first row
  29.         $table->mergeCellRange(1, 1, 1, 2);
  30.        
  31.         // Table border formating
  32.         $border = new PHPRtfLite_Border(
  33.             $rtf,
  34.             new PHPRtfLite_Border_Format(1, '#000000'),
  35.             new PHPRtfLite_Border_Format(1, '#000000'),
  36.             new PHPRtfLite_Border_Format(1, '#000000'),
  37.             new PHPRtfLite_Border_Format(1, '#000000')
  38.         );
  39.        
  40.         $table->setBorderForCellRange($border, 1, 1, 7, 2);
  41.        
  42.        
  43.         // Write data to the table
  44.         $table->writeToCell(1, 1, '<br>Office Details:', $font);
  45.         $table->writeToCell(2, 1, '<br>Name of Company:', $font);
  46.         $table->writeToCell(2, 2, '<br>'.$this_company['Company']['name'], $font);
  47.         $table->writeToCell(3, 1, '<br>Company Limited by:', $font);
  48.         $table->writeToCell(3, 2, '<br>'.$this_company['CompanyType']['name'], $font);
  49.         $table->writeToCell(4, 1, '<br>Notice of Situation of Registered Office:', $font);
  50.         $table->writeToCell(4, 2, '<br>', $font);
  51.         $table->writeToCell(5, 1, '<br>Notice of Situation of Office Hours at Registration:', $font);
  52.         $table->writeToCell(5, 2, '<br>Mondays to Fridays: 9:00am to 5:00pm', $font);
  53.         $table->writeToCell(6, 1, '<br>Address where Register of Members kept if other than the Registered Office:', $font);
  54.         $table->writeToCell(6, 2, '<br>', $font);
  55.         $table->writeToCell(7, 1, '<br>Principal Activities of the Company:', $font);
  56.         $table->writeToCell(7, 2, '<br>'.$this_company['Company']['principal_activity_1'].'<br>'.$this_company['Company']['principal_activity_2'], $font);
  57.        
  58.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER);
  59.         $sect->writeText("<br><b>SUMMARY OF SHARE CAPITAL AND SHARES</b><br>", $font, $parFormat);
  60.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_LEFT);
  61.        
  62.         $table_2 = $sect->addTable(PHPRtfLite_Table::ALIGN_CENTER);
  63.         $table_2->addRow(0.5);
  64.         $table_2->addRow(0.5);
  65.         $table_2->addRow(0.5);
  66.         $table_2->addRow(0.5);
  67.         $table_2->addRow(0.5);
  68.         $table_2->addColumnsList(array(8.5,5,4));
  69.         //Merge the first row
  70.         $table_2->mergeCellRange(1, 2, 1, 3);
  71.        
  72.         $table_2->setBorderForCellRange($border, 1, 1, 5, 3);
  73.        
  74.         $table_2->writeToCell(1, 1, '<br>Currency :', $font);
  75.         $table_2->writeToCell(1, 2, '<b>Singapore Dollars</b>', $font);
  76.  
  77.         $table_2->writeToCell(2, 1, '<b>Class of Shares:</b>', $font);
  78.         $table_2->writeToCell(2, 2, 'Ordinary', $font);
  79.         $table_2->writeToCell(2, 3, 'Preference', $font);
  80.  
  81.         $table_2->writeToCell(3, 1, '<b>Number of Shares:</b>', $font);
  82.         $table_2->writeToCell(3, 2, $this_company['Company']['ordinary_shares'], $font);
  83.         $table_2->writeToCell(3, 3, $this_company['Company']['preference_shares'], $font);
  84.  
  85.         // Merge columns 2 and 3 for the below
  86.         $table_2->mergeCellRange(4, 2, 4, 3);
  87.         $table_2->mergeCellRange(5, 2, 5, 3);
  88.        
  89.         $table_2->writeToCell(4, 1, '<b>Issued Share Capital:</b>', $font);
  90.         $table_2->writeToCell(4, 2, $this_company['Company']['issued_capital'], $font);
  91.  
  92.         $table_2->writeToCell(5, 1, '<b>Paid-up Share Capital:</b>', $font);
  93.         $table_2->writeToCell(5, 2, $this_company['Company']['paid_up_capital'], $font);
  94.        
  95.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER);
  96.         $sect->writeText("<br><b>PARTICULARS OF DIRECTORS, MANAGERS, SECRETARIES, AUDITORS,<br>SHAREHOLDERS AS AT THE DATE OF INCORPORATION</b><br>", $font, $parFormat);
  97.         $parFormat = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_LEFT);
  98.        
  99.         /************Directors table**************/
  100.         $table_3 = $sect->addTable(PHPRtfLite_Table::ALIGN_CENTER);
  101.         $table_3->addRow(0.5);
  102.         $table_3->addRow(0.5);
  103.        
  104.         $table_3->addColumnsList(array(1.5,6.5,4,5.5));
  105.        
  106.         $table_3->mergeCellRange(1,1,1,4);
  107.         $table_3->writeToCell(1,1, "<b>Directors:</b>", $font);
  108.         $table_3->writeToCell(2,1, "<b>S/No.</b>", $font);
  109.         $table_3->writeToCell(2,2, "<b>Name, Address</b>", $font);
  110.         $table_3->writeToCell(2,3, "<b>Id No.</b>", $font);
  111.         $table_3->writeToCell(2,4, "<b>Nationality</b>", $font);
  112.        
  113.         // Fill in all the directors
  114.         $directors_ids = array();
  115.        
  116.         foreach($this_company['Director'] as $director){
  117.             $directors_ids[] = $director['person_id'];
  118.         }
  119.        
  120.        
  121.         $this->Director->Person->recursive = 0;
  122.         $directors = $this->Director->Person->find('all', array(
  123.             'conditions' => array(
  124.                 'OR' => array(
  125.                     'Person.id' => $directors_ids
  126.                 )
  127.             ),
  128.             'contain' => array(
  129.                 'User' => array(
  130.                     'username'
  131.                 )
  132.             )
  133.         ));
  134.        
  135.         $i = 1;
  136.         $start_row = 3;
  137.         foreach($directors as $director){
  138.             $table_3->addRow(0.5);
  139.             $table_3->writeToCell($start_row,1, $i, $font);
  140.             $table_3->writeToCell($start_row,2, $director['Person']['first_name'].' '.$director['Person']['last_name'].', <br>'.$director['Person']['address_field_1'].'<br>'.$this->countryName($director['Person']['address_country']).'-'.$director['Person']['address_postal_code'], $font);
  141.             $table_3->writeToCell($start_row,3, $director['Person']['nric'], $font);
  142.             $table_3->writeToCell($start_row,4, $this->countryName($director['Person']['nationality']), $font);
  143.             $i++;
  144.             $start_row++;
  145.         }
  146.         $table_3->setBorderForCellRange($border, 1, 1, $i+1, 4);
  147.        
  148.         $sect->insertPageBreak();
  149.        
  150.         /************Secretaries table**************/
  151.         $table_4 = $sect->addTable(PHPRtfLite_Table::ALIGN_CENTER);
  152.         $table_4->addRow(0.5);
  153.         $table_4->addRow(0.5);
  154.         $table_4->addColumnsList(array(1.5,6.5,4,5.5));
  155.         $table_4->mergeCellRange(1,1,1,4);
  156.         $table_4->writeToCell(1,1, "<b>Secretary:</b>");
  157.         $table_4->writeToCell(2,1, "<b>S/No.</b>");
  158.         $table_4->writeToCell(2,2, "<b>Name, Address</b>");
  159.         $table_4->writeToCell(2,3, "<b>Id No.</b>");
  160.         $table_4->writeToCell(2,4, "<b>Nationality</b>");
  161.  
  162.        
  163.        
  164.         // Fill in all the Secretaries
  165.         $secretaries_ids = array();
  166.         foreach($this_company['Secretary'] as $secretary){
  167.             $secretaries_ids[] = $secretary['person_id'];
  168.         }
  169.        
  170.         $this->Secretary->Person->recursive = 0;
  171.        
  172.         $secretaries = $this->Secretary->Person->find('all', array(
  173.             'conditions' => array(
  174.                 'OR' => array(
  175.                     'Person.id' => $secretaries_ids
  176.                 )
  177.             ),
  178.             'contain' => array(
  179.                 'User' => array(
  180.                     'username'
  181.                 )
  182.             )
  183.         ));
  184.        
  185.         // Print the table.
  186.         $i = 1;
  187.         $start_row = 3;
  188.         foreach($secretaries as $secretary){
  189.             $table_4->addRow(0.5);
  190.             $table_4->writeToCell($start_row,1, $i, $font);
  191.             $table_4->writeToCell($start_row,2, $secretary['Person']['first_name'].' '.$secretary['Person']['last_name'].', <br>'.$secretary['Person']['address_field_1'].'<br>'.$this->countryName($secretary['Person']['address_country']).'-'.$secretary['Person']['address_postal_code'], $font);
  192.             $table_4->writeToCell($start_row,3, $secretary['Person']['nric'], $font);
  193.             $table_4->writeToCell($start_row,4, $this->countryName($secretary['Person']['nationality']), $font);
  194.             $i++;
  195.             $start_row++;
  196.         }
  197.         $table_4->setBorderForCellRange($border, 1, 1, $i+1, 4);
  198.        
  199.         $sect->writeText("<br><br>");
  200.        
  201.         /************Shareholders table**************/
  202.         $table_5 = $sect->addTable(PHPRtfLite_Table::ALIGN_CENTER);
  203.         $table_5->addRow(0.5);
  204.         $table_5->addRow(0.5);
  205.         $table_5->addColumnsList(array(1.5,4,3,3,3,3));
  206.         $table_5->mergeCellRange(1,1,1,6);
  207.         $table_5->writeToCell(1,1, "<b>Share Holder (s):</b>", $font);
  208.         $table_5->writeToCell(2,1, "<b>S/No.</b>", $font);
  209.         $table_5->writeToCell(2,2, "<b>Name, Address</b>", $font);
  210.         $table_5->writeToCell(2,3, "<b>Id No.</b>", $font);
  211.         $table_5->writeToCell(2,4, "<b>Nationality</b>", $font);
  212.         $table_5->writeToCell(2,5, "<b>Ordinary Shares Held</b>", $font);
  213.         $table_5->writeToCell(2,6, "<b>Preference Shares Held</b>", $font);
  214.        
  215.         // Fill in all the Shareholders
  216.         $shareholder_person_ids = array();
  217.         $ordinary_shares_per_person = array();
  218.         $preference_shares_per_person = array();
  219.         $share_certificate_per_person = array();
  220.         $amount_paid_per_person = array();
  221.        
  222.         $shareholder_company_ids = array();
  223.         $ordinary_shares_per_company = array();
  224.         $preference_shares_per_company = array();
  225.         $share_certificate_per_company = array();
  226.         $amount_paid_per_company = array();
  227.        
  228.         foreach($this_company['Share'] as $shareholder){
  229.             if(!empty($shareholder['shareholder_person_id'])){
  230.                 $shareholder_person_ids[] = $shareholder['shareholder_person_id'];
  231.                
  232.                 $ordinary_shares_per_person[$shareholder['shareholder_person_id']] = $shareholder['number_of_ordinary_shares_alloted_for'];
  233.                
  234.                 $preference_shares_per_person[$shareholder['shareholder_person_id']] = $shareholder['number_of_preference_shares_alloted_for'];
  235.                
  236.                 $share_certificate_per_person[$shareholder['shareholder_person_id']] = $shareholder['certificate_number'];
  237.                
  238.                 $amount_paid_per_person[$shareholder['shareholder_person_id']] = $shareholder['amount_paid_in_cash_for_ordinary_share'] + $shareholder['amount_paid_in_cash_for_preference_share'];
  239.             }
  240.             if(!empty($shareholder['shareholder_company_id'])){
  241.                 $shareholder_company_ids[] = $shareholder['shareholder_company_id'];
  242.                
  243.                 $ordinary_shares_per_company[$shareholder['shareholder_company_id']] = $shareholder['number_of_ordinary_shares_alloted_for'];
  244.                
  245.                 $preference_shares_per_company[$shareholder['shareholder_company_id']] = $shareholder['number_of_preference_shares_alloted_for'];
  246.                
  247.                 $share_certificate_per_company[$shareholder['shareholder_company_id']] = $shareholder['certificate_number'];
  248.                
  249.                 $amount_paid_per_company[$shareholder['shareholder_company_id']] = $shareholder['amount_paid_in_cash_for_ordinary_share'] + $shareholder['amount_paid_in_cash_for_preference_share'];
  250.             }
  251.         }
  252.        
  253.         $this->Share->Person->recursive = 0;
  254.         $this->Share->Company->recursive = 0;
  255.        
  256.         $shareholder_people = $this->Share->Person->find('all', array(
  257.             'conditions' => array(
  258.                 'OR' => array(
  259.                     'Person.id' => $shareholder_person_ids
  260.                 )
  261.             ),
  262.             'contain' => array(
  263.                 'User' => array(
  264.                     'username'
  265.                 )
  266.             )
  267.         ));
  268.        
  269.         if(!empty($shareholder_company_ids)){
  270.             $shareholder_companies = $this->Share->Company->find('all', array(
  271.                 'conditions' => array(
  272.                     'OR' => array(
  273.                         'Company.id' => $shareholder_company_ids
  274.                     )
  275.                 ),
  276.                 'contain' => array(
  277.                     'User' => array(
  278.                         'username'
  279.                     )
  280.                 )
  281.             ));
  282.         }
  283.        
  284.         // Print the table.
  285.         $i = 1;
  286.         $start_row = 3;
  287.         if(isset($shareholder_people)){
  288.            
  289.             foreach($shareholder_people as $shareholder){
  290.                 $table_5->addRow(0.5);
  291.                 $table_5->writeToCell($start_row,1, $i, $font);
  292.                 $table_5->writeToCell($start_row,2, $shareholder['Person']['first_name'].' '.$shareholder['Person']['last_name'].', <br>'.$shareholder['Person']['address_field_1'].'<br>'.$this->countryName($shareholder['Person']['address_country']).'-'.$shareholder['Person']['address_postal_code'], $font);
  293.                 $table_5->writeToCell($start_row,3, $shareholder['Person']['nric'], $font);
  294.                 $table_5->writeToCell($start_row,4, $this->countryName($shareholder['Person']['nationality']), $font);
  295.                 $table_5->writeToCell($start_row,5, $ordinary_shares_per_person[$shareholder['Person']['id']], $font);
  296.                 $table_5->writeToCell($start_row,6, $preference_shares_per_person[$shareholder['Person']['id']], $font);
  297.                 $i++;
  298.                 $start_row++;
  299.             }
  300.         }
  301.         if(isset($shareholder_companies)){
  302.            
  303.             foreach($shareholder_companies as $shareholder){
  304.                 $table_5->addRow(0.5);
  305.                 $table_5->writeToCell($start_row,1, $i, $font);
  306.                 $table_5->writeToCell($start_row,2, $shareholder['Company']['name'].', <br>'.$shareholder['Company']['office_address_field_1'].'<br>'.$this->countryName($shareholder['Company']['office_address_country']).'-'.$shareholder['Company']['office_address_postal_code'], $font);
  307.                 $table_5->writeToCell($start_row,3, 'Reg. No: '.$shareholder['Company']['number'], $font);
  308.                 $table_5->writeToCell($start_row,4, 'N/A', $font);
  309.                 $table_5->writeToCell($start_row,5, $ordinary_shares_per_company[$shareholder['Company']['id']], $font);
  310.                 $table_5->writeToCell($start_row,6, $preference_shares_per_company[$shareholder['Company']['id']], $font);
  311.                 $i++;
  312.                 $start_row++;
  313.             }
  314.         }
  315.        
  316.         $table_5->setBorderForCellRange($border, 1, 1, $i+1, 6);
  317.  
  318.         $sect->writeText('<br>');
  319.        
  320.         // Certification:
  321.         $table_6 = $sect->addTable(PHPRtfLite_Table::ALIGN_CENTER);
  322.         $table_6->addRow(0.5);
  323.         $table_6->addRow(0.5);
  324.         $table_6->addColumnsList(array(17.5));
  325.  
  326.         $table_6->writeToCell(1,1, '<b><u>Certification</u></b>', $font);
  327.         $table_6->writeToCell(2,1, 'I, the undermentioned officer of the abovementioned company, hereby certify that the particulars of the above company for the purpose of incorporation are true and accurate at registration:<br><br>', $font);
  328.         $table_6->writeToCell(2,1, 'Signature: ______________________<br><br>', $font);
  329.         $table_6->writeToCell(2,1, 'Name of Director: <u>'.$director_1['Person']['first_name'].' '.$director_1['Person']['last_name'].'</u><tab>Date:', $font);
  330.        
  331.         $table_6->setBorderForCellRange($border, 1, 1, 2, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement