Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:gsoc09_pr [2009/08/14 00:42]
kethees
dev:gsoc09_pr [2009/08/14 01:21] (current)
kethees
Line 23: Line 23:
  
 == Future Enhancement(s) == == Future Enhancement(s) ==
 +   * Integrating Person Registry with other person oriented modules.
    * Tracking person roles such missing person, disaster victim, logistic oriented person and etc within PR.    * Tracking person roles such missing person, disaster victim, logistic oriented person and etc within PR.
- +   * Enhancing Person API and lib_chart.inc library functionalities.
  
 ===== Person API ===== ===== Person API =====
Line 34: Line 34:
  
 The function for person form is as follows: The function for person form is as follows:
-     <code php> +<code php> 
- shn_form_person(); +shn_form_person(); 
-     </code>+</code>
 Above function will include form elements in your form Above function will include form elements in your form
-     <code php> +<code php> 
- <input name="full_name" id="full_name" value="" disabled="disabled" tabindex="1" type="text"> +<input name="full_name" id="full_name" value="" disabled="disabled" tabindex="1" type="text"> 
- <input name="person_id" value="" type="hidden"> +<input name="person_id" value="" type="hidden"> 
- <input value="Add" onclick="popup_show(... " type="button"> +<input value="Add" onclick="popup_show(... " type="button"> 
-     </code>+</code>
  
 In Add button click event person form is poped up with following form fields In Add button click event person form is poped up with following form fields
Line 59: Line 59:
  
 person_class.php person_class.php
-   <code php>+<code php>
     * $person = New Person();     * $person = New Person();
  
Line 66: Line 66:
     * $person->get_person($p_uuid);     * $person->get_person($p_uuid);
     * $person->delete_person($p_uuid);     * $person->delete_person($p_uuid);
-   </code>+</code>
  
 group_class.php group_class.php
-   <code php>+<code php>
     * $group = New Group();     * $group = New Group();
  
Line 77: Line 77:
     * $group->get_group($g_uuid);     * $group->get_group($g_uuid);
     * $group->delete_group($g_uuid);     * $group->delete_group($g_uuid);
-    </code>+</code>
  
 address_class.php address_class.php
-    <code php>+<code php>
     * $address = New Address();     * $address = New Address();
  
Line 86: Line 86:
     * $address->update_person_address();     * $address->update_person_address();
     * $address->get_person_address($p_uuid);     * $address->get_person_address($p_uuid);
-    </code>+</code>
  
 identity_class.php identity_class.php
-    <code php>+<code php>
     * $identity = New Identity();     * $identity = New Identity();
  
Line 95: Line 95:
     * $identity->update_person_identity();     * $identity->update_person_identity();
     * $identity->get_person_identity($p_uuid);     * $identity->get_person_identity($p_uuid);
-    </code>+</code> 
 + 
 +===== Open Flash Chart Library ===== 
 + 
 +This allows you to creat a chart with Flash capability. In order to use following function, you need to do is include lib_chart.inc library and call the shn_draw_chart() API function. 
 + 
 +== Chart API == 
 + 
 +    * lib_chart.inc library includes following code snippets. 
 +<code php> 
 +   include_once $global['approot']. '/3rd/php-ofc-library/open_flash_chart_object.php'; 
 +   include_once $global['approot'] .'/3rd/php-ofc-library/open-flash-chart.php'; 
 + 
 +   function shn_draw_chart($width, $height, $data_file_url) 
 +   { 
 +       $base = 'res/ofc/'; 
 +       open_flash_chart_object($width, $height,$data_file_url,true,$base); 
 +   } 
 + 
 +</code> 
 + 
 +Sample $data_file_url formed via stream as follows. 
 + 
 +e.g: 
 +<code php> 
 +$url_gender = 'index.php?mod=pr&act=gender&stream=text'; 
 +</code> 
 + 
 +<code php> 
 +   function shn_text_pr_gender(){  
 +      $array = Data::get_pr_gender(); 
 +      $data = $array['data']; 
 +      $label = $array['label']; 
 + 
 +      foreach($data as $d){ 
 +         $total += $d; 
 +      }  
 +       
 +      foreach($data as $key=>$d){ 
 +         $data[$key] = round(($d/$total*100),2); 
 +      }
  
 +      $g = new graph();
 +      $g->bg_colour='#FFFFFF';
 +      $g->pie(60,'#505050','{font-size: 10px; color: #404040;');
 +      $g->pie_values( $data, $label );
 +      $g->pie_slice_colours( array('#31A43F','#A79810','#D21389') );
 +      $g->set_tool_tip( ' Label: #x_label#<br>Value: #val#%' );
 +      $g->title( 'Gender', '{font-size:14px; color: #d01f3c}' );
 +      echo $g->render();
 +   }
 +</code>
 == Ontology == == Ontology ==
     * [[dev:pr_class_diagram_1.03.png | Modified draft version of Person class diagram]]     * [[dev:pr_class_diagram_1.03.png | Modified draft version of Person class diagram]]

Navigation
QR Code
QR Code dev:gsoc09_pr (generated for current page)