PX : code

ApPHP MicroBlog by Chara Miteo
Download this code


 <?php 
$objResources 
= new Resources();
    
    if(
$action == "add"){
        
$mode "add";
    }else if(
$action == "create"){
        if(
$objResources->AddRecord()){
            
$msg draw_success_message(ADDING_OPERATION_COMPLETEDfalse);
            
$mode "view";
        }else{
            
$msg draw_important_message($objResources->errorfalse);
            
$mode "add";
        }
    }else if(
$action == "edit"){
        
$mode "edit";
    }else if(
$action == "update"){
        if(
$objResources->UpdateRecord($rid)){
            
$msg draw_success_message(UPDATING_OPERATION_COMPLETEDfalse);
            
$mode "view";
        }else{
            
$msg draw_important_message($objResources->errorfalse);
            
$mode "edit";
        }        
    }else if(
$action == "delete"){
        if(
$objResources->DeleteRecord($rid)){
            
$msg draw_success_message(DELETING_OPERATION_COMPLETEDfalse);
        }else{
            
$msg draw_important_message($objResources->errorfalse);
        }
        
$mode "view";
    }else if(
$action == "details"){
        
$mode "details";        
    }else if(
$action == "cancel_add"){        
        
$mode "view";        
    }else if(
$action == "cancel_edit"){                
        
$mode "view";
    }


Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.