Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
String Manipulation Support
Old 03-12-2008, 01:00 AM String Manipulation Support(Solved)
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
PHP Code:
<?php
$myText 
"A survey conducted by PricewaterhouseCoopers reveals that there is a strong correlation between project management maturity and project performance.  PricewaterhouseCoopers intended to study the best practices of project management. In this survey, two hundred responses were collected from a diverse group of small to medium-sized companies of thirty different countries across the globe.  The participants in this survey included top manager (33%), senior manager (32%), project manager (28%), and project team manager (7%).<br><br>***
The survey unveiled the following findings:<br>
1.0    High maturity level delivers high project performance<br>
There is a positive correlation between project management maturity level and project performance. Project management process maturity (PM) model adopts a systematic approach to establish an organization’s current project management level. Each maturity level consists of major project management characteristics, factors, and processes (Kwak et al, 2002).  Maturity level is broken down into unreliable processes, informal processes, standardized processes, monitored processes, and optimized processes.<br><br>***
2.0    Current overall maturity level falls under informal processes (2.5)<br>
The current maturity level for most companies is around 2.5, denoting the level of informal process that is not yet institutionalized. In other words, a formally approved project management methodology is missing and therefore project participants do not adopt appropriate standards during the projects.<br><br>***
3.0    Organizations seek to improve their maturity levels<br>
About 60% of the companies wish to attain a higher maturity level. Although it is not pragmatism to increase their maturity level by more than one level, 36% of the companies want to do so. Elevating to a higher level (e.g.: increasing from level 2 to level 3) requires a very rigorous effort; any standard process must adequately address the needs of the variety of projects that are undertaken in an organization (Grant et. al, 2006).<br><br>***
4.0    Imbalanced organization is the culprit of project failures<br>
While missed deadlines and scope changes are frequently cited as reasons for project failures, poor quality of the deliverables and inadequate definitions from stakeholders have the least influence to project failures. Project managers are often the lamb waiting to be slaughtered in most cases of project failure but 59% of reasons attributed to project failures are usually beyond the control of project managers.<br><br>***
5.0    Organizational structure makes or breaks project performance<br>
Organizational structure has great influence to project performance. The survey outlines five organizational types defined by Project Management Institute (PMI): functional, weak matrix, balanced matrix, strong matrix, and projectized. “Projectized” or “strong matrix” structures produce high performance mainly because project managers have more influence in projects and project management is widely identified as a core aspect in the organizations. On the other hand, the “balanced matrix” and “weak matrix” yield poor results.<br><br>***
6.0    Industry, location, and business objectives decide the optimal organization structure<br>
African organizations mainly have functional structure whereas European and the Americans have similar structure spread. Asian organizations, in this regard, mostly employ a strong matrix structure that yields high maturity. Industry wise, public sector uses weak matrix and therefore has low maturity level. Pharmaceutical sector, on the other hand, adopts “balanced matrix”. The highest maturity level belongs to Technology, Information, Communication and Entertainment (TICE) that espouse “strong matrix” structure.<br><br>***
7.0    Investing in staff boosts project performance<br>
60% of the companies do not offer development programme to staff and only 8% of the companies have a standard development programme. The survey reveals that there is a positive correlation between frequent offers of development programme and project performance. In other words, organizations that have a development programme should expect a higher return in project performance.<br><br>***
8.0    Getting your staff certified is a smart move<br>
Having project management certifications has positive influence in maturity level. Only 27% of the companies do not have any type of certifications. Companies that attain higher score in maturity level have certified staff but the opposite is true for the companies that score low in maturity level. Certified staff creates knowledge base in organizations and applies standard project management methodology.<br><br>***
9.0    Change management gives organization a competitive edge<br>
The central idea of any change management system is to anticipate, recognize, evaluate, resolve, document, and learn from conflicts in ways that support the overall viability of the project (Ibbs, 2001). The analysis unveils the fact that there is a clear link between change management and the best performing organizations. 26 out of 27 companies that score the highest in performance employ change management approach.<br><br>***
10.0 External resources are added-value when used in smaller scale<br>
Highest performance is achieved when a rate 25% of external resources is used. A ratio of higher than 25% will not yield higher performance. In some sectors (e.g.: health care), coordination and management of external resources is inherently unstable (Walt et al, 1999). Another interesting point is that the number of external resources varies depending on the company maturity’s level.<br><br>***
11.0 Organization’s maturity level has great influence on the implementation of project management software<br>
Organizations with low maturity level are adversely affected by project management software. Once an organization reaches higher maturity level with institutionalized processes, the implementation of project management software will remarkably augment overall project performance."
;

main($myText);
$chars_per_page;

 function 
main($myText)
 {
    
$total_page count_page($myText);
    
$text_array set_page_array($myText$total_page);
    
$index_array get_breakpoints($text_array$total_page);
    
$page gets_page($total_page);
    
get_text_page($page$index_array$text_array);
    
print_page_num($index_array$page);
 }

 function 
gets_page($total_page)
  {
    
$page=1;
       if (isset (
$_REQUEST['page']))  {
            if (
validate_page($_REQUEST['page'], $total_page)) {
                   
$page $_REQUEST['page'];
                   }
            }
            return 
$page;
  }

 function 
get_text_page($page$index_array$text_array)
    {
        
$start_index $index_array[$page -2];
        
$end_index $index_array[$page -1];

            if (
$page==1) {
                  
$new_text substr($text_array[0], 0$index_array[0]); }
            elseif (
$page==count($text_array)){
                  
$new_text substr($text_array[$page -2], $start_index).substr($text_array [$page-1] ,0);}

            else { 
$new_text substr($text_array[$page -2], $start_index).substr($text_array [$page-1] ,,$end_index);}

        
$new_text str_replace ("***"""$new_text);
                echo 
"$new_text";    }

 function 
count_page ($myText)
    {
        
$total_chars strlen($myText);
        
$GLOBALS['chars_per_page'] = 1000;
        
$total_page intval($total_chars $GLOBALS['chars_per_page']);
        return 
$total_page;
    }

 function 
get_breakpoints ($text_array$total_page)
    {
        
$page_index = array();
        
$prev_index 0;
        for (
$i=1$i <= $total_page$i++)
            {
                
$page $i;
                
$end_index strrpos ($text_array[$i -1], "***");
                 
array_push ($page_index$end_index);
            }
        return 
$page_index;
    }

 function 
set_page_array ($myText$total_page)
    {
        
$chars_per_page =$GLOBALS['chars_per_page'];
        
$text_array = array();
        for (
$i=1$i <= total_page$i++)
            {
                
$start_index $chars_per_page * ($i -1);
                
$end_index $chars_per_page $i;
                
$length strlen($myText);
       
$text_array[$i -1] = substr($myText$start_index$end_index $start_index);
        if (
$i==$total_page)
            {
                
$text_array[$i -1] = substr($myText$start_index);
            }
    }
       return 
$text_array;
    }

 function 
validate_page ($page$total_page)
    {
        if (
ereg("[^0-9]"$page)){
        return 
false; }
        elseif (
$page <=|| $page $total_page){
            return 
false;
    }
        return 
true;
    }

 function 
print_page_num ($total_page_array$page)
    {

 
$this_page $_SERVER['PHP_SELF'];
 
$print_page "<br><br>";

 if (
$page >1){
    
$prev_page $page -1;
    
$print_page.= "<a href = '$this_page?page=$prev_page'>Prev</a>&nbsp;&nbsp;";}

 for (
$i=1$i <=count($total_page_array); $i++) {
        
$print_page .= "<a href = '$this_page?page=$i'>$i</a>&nbsp;&nbsp;"; }

 if (
$page count($total_page_array)){
     
$next_page $page 1;
     
$print_page .= "<a href = '$this_page?page=$next_page'>Next</a>&nbsp;&nbsp;";} 
     echo 
$print_page;
     }
     
    
?>
The above code is what I have so far. But I cannot get the 1000 character limit per page. To show up. All I get is the page numbers 1-6.

Thank you for your time.

Red_X_
__________________
"Good News Everyone, by reading this your hearing my voice."

Last edited by Red_X_; 03-12-2008 at 08:14 AM.. Reason: Solved.
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 03-12-2008, 08:06 AM Re: String Manipulation Support
Extreme Talker

Posts: 246
Trades: 3
Happens to me all the time. You forgot a '$' before the variable total_page in the set_page_array function:
PHP Code:
 function set_page_array ($myText$total_page)
    {
        
$chars_per_page =$GLOBALS['chars_per_page'];
        
$text_array = array();
        for (
$i=1$i <= total_page$i++) 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CouponGuy is offline
Reply With Quote
View Public Profile
 
Old 03-12-2008, 08:13 AM Re: String Manipulation Support
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
Quote:
Originally Posted by CouponGuy View Post
Happens to me all the time. You forgot a '$' before the variable total_page in the set_page_array function:
PHP Code:
 function set_page_array ($myText$total_page)
    {
        
$chars_per_page =$GLOBALS['chars_per_page'];
        
$text_array = array();
        for (
$i=1$i <= total_page$i++) 
haha. Thank you. It was late, and I couldn't find it. I appreciate the support. talk++
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
Reply     « Reply to String Manipulation Support
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12566 seconds with 12 queries