Are you a regular stikked user? Signup so you can keep track of your pastes!
  1. <?php
  2. class Criticalissues extends Controller {
  3.  
  4. /**************** Critical Issues Applications **********************************
  5. *                                                                               *
  6. *       Critical Issues Applicaton was first written as a simple application so our     *
  7. *       Project Managers were able to keep track of critical issues in the Mono         *
  8. *       Type Company. It was later built into Monotypes Intranet Portal giving it   *
  9. *       a secure and standardize environment to work from.                          *
  10. *                                                                               *
  11. *********************************************************************************/             
  12.  
  13. /*********************** Construct **********************************************
  14. *       Constructs are ran each time the controller is called.                                  *
  15. *********************************************************************************/
  16.  
  17.         function Criticalissues()
  18.         {
  19.                 parent::Controller();
  20.                 // User Auth
  21.                 $this->auth->restrict('manager');
  22.                 // Pull layout information from library layout and dataset.
  23.                 $this->data['pass'] = $this->layout->index();
  24.                 $this->data['common'] = $this->dataset->index();
  25.         }
  26.  
  27. /*************** Critical Issues Index or Main Page *****************************
  28. *       Index is the main or starting page for the Critical Issues Site. The first      *
  29. *       page brought up from entering into the Critical Issues Application is       *
  30. *       exicuted from Index.                                                                                                    *
  31. *********************************************************************************/
  32.         function index()
  33.         {      
  34.        
  35.                 // CI Loaders
  36.                 $this->load->helper('date');
  37.                 $this->load->database();
  38.                 $this->load->model('cissues_model', 'cissues');
  39.                
  40.                 // Recieve information from post
  41.                 $data = $this->input->post('input');
  42.                
  43.                 // Pull all projects from Critical Issues based off of default
  44.                 // or user selected sort.      
  45.                 $this->data['cissues'] = $this->cissues->listActiveProjects($data);
  46.                 // Pull Listing of all Archive Dates for drop down list for main page.
  47.                 $this->data['pullArchiveDate'] = $this->cissues->pullArchiveDate();
  48.                 // Checking and setting for Active Projects
  49.                 if(isset($data['active']) == false and isset($data['search'])== false)
  50.                 {
  51.                         $this->data['active'] = 'on';
  52.                 }
  53.                 elseif(isset($data['active']))  
  54.                 {
  55.                         $this->data['active'] = $data['active'];
  56.                 }
  57.                 // Checking and setting for searh criteria.
  58.                 if(isset($data['search']) == false)
  59.                 {
  60.                         $this->data['search'] = '';
  61.                 }
  62.                 elseif (isset($data['search']))
  63.                 {
  64.                         $this->data['search'] = $data['search'];
  65.                 }
  66.                        
  67.                         // Setting up variables to be past to the view 
  68.                         if(isset($data['archive'])) $this->data['archive'] = $data['archive'];         
  69.                         if(isset($data['job_sort'])) $this->data['job_sort'] = $data['job_sort'];
  70.                         if(isset($data['title_sort'])) $this->data['title_sort'] = $data['title_sort'];
  71.                         if(isset($data['client_sort'])) $this->data['client_sort'] = $data['client_sort'];
  72.                         if(isset($data['departments_sort'])) $this->data['departments_sort'] = $data['departments_sort'];
  73.                         if(isset($data['projectm_sort'])) $this->data['projectm_sort'] = $data['projectm_sort'];
  74.                 // Display the view index from critical issues.
  75.                 $this->mysmarty->view('criticalissues/index', $this->data);                                                            
  76.         }
  77.        
  78.         function test()
  79.         {
  80.                 $this->mysmarty->view('criticalissues/test');          
  81.  
  82.         }
  83.        
  84.         /*********************** Print Issues Page  *************************************
  85.         *       Print Issues based off of sort criterias user has set.                                          *
  86.         *********************************************************************************/
  87.         function printIssues()
  88.         {
  89.                 // CI Load Database
  90.                 $this->load->database();
  91.                 $this->load->model('cissues_model', 'cissues');
  92.                 // Take in submited inforamation in this case search critiera and pass
  93.                 // it to the list all issues query.
  94.                 $data = $this->input->post('input');
  95.                 $this->data['cissues'] = $this->cissues->listActiveProjects($data);
  96.                 // Pass the return from the query to the view printIssues
  97.                 $this->mysmarty->view('criticalissues/printIssues', $this->data);              
  98.         }
  99.        
  100.         /************************* New Issues Page  *************************************
  101.         *       Calling funtion for creating a new issue.                                                                       *
  102.         *********************************************************************************/     
  103.         function newIssue()
  104.         {
  105.                 $this->load->database();
  106.                 $this->load->model('cissues_model', 'cissues');
  107.                 $this->data['pullPM'] = $this->cissues->pullPM();
  108.                 $this->data['pullOutsource'] = $this->cissues->pullOutsource();
  109.                 $this->mysmarty->view('criticalissues/issue',$this->data);
  110.                
  111.         }
  112.  
  113.         /*********************** Insert Issue Page  *************************************
  114.         *       Insert new Issue                                                                                                                        *
  115.         *********************************************************************************/     
  116.         function insertIssue()
  117.         {
  118.        
  119.                 $data = $this->input->post('input');                   
  120.                 $this->load->model('cissues_model', 'cissues');
  121.                 $this->cissues->insertIssue($data);
  122.                 $this->index();
  123.        
  124.         }
  125.  
  126.         /*********************** Update Issues  *****************************************
  127.         *       Update Issue                                                                                                                            *
  128.         *********************************************************************************/     
  129.         function updateIssue()
  130.         {
  131.        
  132.                 $data = $this->input->post('input');                   
  133.                 $this->load->model('cissues_model', 'cissues');
  134.                 $this->cissues->updateIssue($data);
  135.                 $this->index();
  136.        
  137.         }
  138.        
  139.         /*********************** Edit Issues Page  **************************************
  140.         *       Page to edit issues                                                                                                                     *
  141.         *********************************************************************************/     
  142.         function editIssue()
  143.         {
  144.                         $data = $this->input->post('input');
  145.                         if(isset($data['archive'])) $this->data['archive'] = $data['archive'];
  146.                         if(isset($data['search'])) $this->data['search'] = $data['search'];
  147.                         if(isset($data['active'])) $this->data['active'] = $data['active'];
  148.                         if(isset($data['job_sort'])) $this->data['job_sort'] = $data['job_sort'];
  149.                         if(isset($data['title_sort'])) $this->data['title_sort'] = $data['title_sort'];
  150.                         if(isset($data['client_sort'])) $this->data['client_sort'] = $data['client_sort'];
  151.                         if(isset($data['departments_sort'])) $this->data['departments_sort'] = $data['departments_sort'];
  152.                         if(isset($data['projectm_sort'])) $this->data['projectm_sort'] = $data['projectm_sort'];
  153.                
  154.                 $this->load->model('cissues_model', 'cissues');
  155.                 $this->data['cissues'] = $this->cissues->editIssue($data);                     
  156.                 $this->data['pullPM'] = $this->cissues->pullPM();
  157.                 $this->data['pullOutsource'] = $this->cissues->pullOutsource();
  158.                
  159.                 if(isset($data['archive']) and $data['archive'] != "")
  160.                 {
  161.                         $this->mysmarty->view('criticalissues/viewArchive',$this->data);
  162.                 }
  163.                 else $this->mysmarty->view('criticalissues/viewIssue',$this->data);            
  164.         }
  165.  
  166.         /*********************** Remove Issues Page  ************************************
  167.         *       Print Issues based off of sort criterias user has set.                                          *
  168.         *********************************************************************************/
  169.         function removeIssue()
  170.         {
  171.                 $data = $this->input->post('input');
  172.                 $this->load->model('cissues_model', 'cissues');
  173.                 $this->data['cissues'] = $this->cissues->removeIssue($data);                   
  174.                 $this->index();
  175.         }
  176.        
  177.  
  178. /**************** Manage Critical Applications **********************************
  179. *       This section of the controller is for manageing the internal areas, like        *
  180. *       working with Adding and Removing Managers.                                                                      *
  181. *                                                                                                                                                               *
  182. *********************************************************************************/             
  183.  
  184. /*********************** First Page Manager *************************************
  185. *       This page lists all managers functions for cirtical applications                        *
  186. *********************************************************************************/
  187.         function manage()
  188.         {
  189.                 $data = $this->input->post('input');
  190.                 $this->load->database();
  191.                 $this->load->model('cissues_model', 'cissues');        
  192.                
  193.                 //****************** ADD MANGER *****************************************
  194.                 if (isset($data['submit']) and $data['submit'] == "addManager")
  195.                 {
  196.                         $this->cissues->addManager($data);     
  197.                 }
  198.                
  199.                 //****************** DELETE MANGER *****************************************
  200.                 if (isset($data['submit']) and $data['submit'] == "delManager")
  201.                 {
  202.                         $this->cissues->delManager($data);     
  203.                 }
  204.                 //****************** Edit MANGER *****************************************
  205.                 if (isset($data['submit']) and $data['submit'] == "editManager")
  206.                 {      
  207.                         if(isset($data['id'])) $this->data['man_id'] = $data['id'];
  208.                         if(isset($data['submit'])) $this->data['submit'] = $data['submit'];
  209.  
  210.                 }      
  211.                 //****************** Edit MANGER *****************************************
  212.                 if (isset($data['submit']) and $data['submit'] == "updateManager")
  213.                 {
  214.                         $this->cissues->updateManager($data);
  215.                 }              
  216.                
  217.                 $this->data['cissues'] = $this->cissues->pullPM();
  218.                 $this->mysmarty->view('criticalissues/manage', $this->data);   
  219.         }      
  220. //************************* END MANAGERS ***************************************       
  221.        
  222.  
  223. }
  224.  

Reply to "Untitled"

Here you can reply to the paste above

Create a snipurl

Make Private

Feeling clever? Set some advanced options.