内部服务器错误500. codeigniter

时间:2015-10-30 09:24:18

标签: php codeigniter server

所以我一直在尝试修复内部服务器500错误。它显示在网站的管理仪表板面板上。所以这是管理员凭证的网站http://www.fabcoders.com/ghostwriter/home/login 用户名:admin 口令:admin123

所以一旦你登录它就会给出internel服务器错误。管理面板中的另一个链接类似于http://fabcoders.com/ghostwriter/admin/users

但只有仪表板面板不起作用。

网站上传到godaddy,我的同事告诉我,它可能是使用php 5.2版本,编码是5.5,我不太确定这会导致问题。

这是控制器部分的代码。

<?php
class dashboard extends Admin_Controller
{
    public function __construct ()
   {
        parent::__construct();
        $this->load->library('table');
       $this->load->library("pagination");      
    }

    public function index ($type='accept')
     {
         $user_id = $this->session->userdata("id");
         $this->load->model("admin_dashboard_m");
         $user_count = $this->admin_dashboard_m->get_user_count();
         $this->data['user_count'] = $user_count ;
         $approved_project_count=$this->admin_dashboard_m->get_approved_project_count();
         $this->data['approved_project_count']=$approved_project_count;
         $approved_project_count_today=$this->admin_dashboard_m->approved_project_count_today();
          $this->data['approved_project_count_today']=$approved_project_count_today;
        $approved_project_count_tweek=$this->admin_dashboard_m->approved_project_count_tweek();
            $this->data['approved_project_count_tweek']=$approved_project_count_tweek;

        $approved_project_count_lweek=$this->admin_dashboard_m->approved_project_count_lweek();
        $this->data['approved_project_count_lweek']=$approved_project_count_lweek;

        $approved_project_count_tmonth=$this->admin_dashboard_m->approved_project_count_tmonth();
        $this->data['approved_project_count_tmonth']=$approved_project_count_tmonth;

        $approved_project_count_lmonth=$this->admin_dashboard_m->approved_project_count_lmonth();
        $this->data['approved_project_count_lmonth']=$approved_project_count_lmonth;

        $get_notapproved_project_count=$this->admin_dashboard_m->get_notapproved_project_count();
         $this->data['get_notapproved_project_count']=$get_notapproved_project_count;

        $get_admin_rejected_proj_count=$this->admin_dashboard_m->get_admin_rejected_proj_count();
        $this->data['get_admin_rejected_proj_count']=$get_admin_rejected_proj_count;

        $complete_article_count=$this->admin_dashboard_m->get_complete_article_count();
        $this->data['complete_article_count']=$complete_article_count;

        $complete_project_count=$this->admin_dashboard_m->get_complete_project_count();
        $this->data['complete_project_count']=$complete_project_count;

        $this->data['pcat'] = array(1=>'Computers and Technology',2=>'Arts and Entertainment',3=>'Fashion',4=>'Food and Drinks',5=>'Health and Fitness',6=>'Sports');

    //displaying approved project list with paging
    if($this->input->post('submit'))
        {
        if($this->input->post('filter')=="today")
        {
        $approved=$approved_project_count_today;
        }
        else if($this->input->post('filter')=="this_week")
        {
         $approved=$approved_project_count_tweek;
        }
         else if($this->input->post('filter')=="last_week")
        {
        $approved=$approved_project_count_lweek;
        }
        else if($this->input->post('filter')=="this_month")
        {
        $approved=$approved_project_count_tmonth;
        }
        else if($this->input->post('filter')=="last_month")
        {
        $approved=$approved_project_count_lmonth;
        }
        else if($this->input->post('filter')=='all')
        {
        $approved=$approved_project_count;
        }
        else
        {
        $approved=$approved_project_count;
        }

        $config = array();
        $config["base_url"] = base_url() . "admin/dashboard/index/accept";
        $config["total_rows"] = $approved;
        $config["per_page"] = 10;
        $config["uri_segment"] = 5;
        $choice = $config["total_rows"] / $config["per_page"];
        $config["num_links"] = round($choice);
        $page = ($this->uri->segment(5)) ? $this->uri->segment(5) : 0;
        $get_approved_project_list=$this->admin_dashboard_m->get_approved_project_list($config["per_page"], $page);
        $this->data['get_approved_project_list']=$get_approved_project_list;

            $config['full_tag_open'] = '<ul class="tsc_pagination tsc_paginationA tsc_paginationA01">';
            $config['full_tag_close'] = '</ul>';
            $config['prev_link'] = '  &lt; Previous';
            $config['prev_tag_open'] = '<li>';
            $config['prev_tag_close'] = '</li>';
            $config['next_link'] = 'Next &gt;';
            $config['next_tag_open'] = '<li>';
            $config['next_tag_close'] = '</li>';
            $config['cur_tag_open'] = '<li class="current"><a href="#">';
            $config['cur_tag_close'] = '</a></li>';
            $config['num_tag_open'] = '<li>';
            $config['num_tag_close'] = '</li>';

            $config['first_tag_open'] = '<li>';
            $config['first_tag_close'] = '</li>';
            $config['last_tag_open'] = '<li>';
            $config['last_tag_close'] = '</li>';

            $config['first_link'] = '&laquo; First';
            $config['last_link'] = 'Last &raquo;';
            $this->pagination->initialize($config);
            $this->data["links"] = $this->pagination->create_links();
            }

            {
            $config = array();
            $config["base_url"] = base_url() . "admin/dashboard/index/wait";
            $config["total_rows"] = $get_notapproved_project_count;
            $config["per_page"] = 10;
            $config["uri_segment"] = 5;
            $choice = $config["total_rows"] / $config["per_page"];
            $config["num_links"] = round($choice);
            $page = $type=='wait'?(($this->uri->segment(5)) ? $this->uri->segment(5) : 0):0;
            $get_notapproved_project_list=$this->admin_dashboard_m->get_notapproved_project_list($config["per_page"], $page);
            $this->data['get_notapproved_project_list']=$get_notapproved_project_list;

            $config['full_tag_open'] = '<ul class="tsc_pagination tsc_paginationA tsc_paginationA01">';
            $config['full_tag_close'] = '</ul>';
            $config['prev_link'] = '  &lt; Previous';
            $config['prev_tag_open'] = '<li>';
            $config['prev_tag_close'] = '</li>';
            $config['next_link'] = 'Next &gt;';
            $config['next_tag_open'] = '<li>';
            $config['next_tag_close'] = '</li>';
            $config['cur_tag_open'] = '<li class="current"><a href="#">';
            $config['cur_tag_close'] = '</a></li>';
            $config['num_tag_open'] = '<li>';
            $config['num_tag_close'] = '</li>';

            $config['first_tag_open'] = '<li>';
            $config['first_tag_close'] = '</li>';
            $config['last_tag_open'] = '<li>';
            $config['last_tag_close'] = '</li>';

            $config['first_link'] = '&laquo; First';
            $config['last_link'] = 'Last &raquo;';
            $this->pagination->initialize($config);
            $this->data["links3"] = $this->pagination->create_links();
           }
         {
           $config = array();
           $config["base_url"] = base_url() . "admin/dashboard/index/reject";
           $config["total_rows"] = $get_admin_rejected_proj_count;
           $config["per_page"] = 5;
           $config["uri_segment"] = 5;
           $choice = $config["total_rows"] / $config["per_page"];
           $config["num_links"] = round($choice);
           $page = $type=='reject'?(($this->uri->segment(5)) ? $this->uri->segment(5) : 0):0;
            $config['full_tag_open'] = '<ul class="tsc_pagination tsc_paginationA tsc_paginationA01">';
            $config['full_tag_close'] = '</ul>';
            $config['prev_link'] = '  &lt; Previous';
            $config['prev_tag_open'] = '<li>';
            $config['prev_tag_close'] = '</li>';
            $config['next_link'] = 'Next &gt;';
            $config['next_tag_open'] = '<li>';
            $config['next_tag_close'] = '</li>';
            $config['cur_tag_open'] = '<li class="current"><a href="#">';
            $config['cur_tag_close'] = '</a></li>';
            $config['num_tag_open'] = '<li>';
            $config['num_tag_close'] = '</li>';

            $config['first_tag_open'] = '<li>';
            $config['first_tag_close'] = '</li>';
            $config['last_tag_open'] = '<li>';
            $config['last_tag_close'] = '</li>';

            $config['first_link'] = '&laquo; First';
            $config['last_link'] = 'Last &raquo;';


           $this->pagination->initialize($config);
            $get_admin_rejected_proj_list=$this->admin_dashboard_m->get_admin_rejected_proj_list($config["per_page"], $page);
           $this->data['get_admin_rejected_proj_list']=$get_admin_rejected_proj_list;

    $this->data["links2"] = $this->pagination->create_links();
    }
       $this->data['dashboard_type']=$type;
        $this->data['subview'] = 'admin/dashboard/index';
       $this->load->view('admin/_layout_main_1', $this->data);
    }
 ?>

以下是视图部分。

          <ul class="tabrow" role="tablist">
            <li <?php echo in_array($dashboard_type,array('accept','wait','reject'))?'class="selected "':' '?>  >Admin Dashboard</li>
          </ul>
          <div class="float-right margin-top-10 margin-right-100">

          <form action="dashboard" method ="POST">
          <select class="select-style " onchange="this.form.submit()" name="filter">
             <option value="filter type">Filter Type</option>
             <option value="today">Today's</option>
            <option value="this_week">This Week</option>
            <option value="last_week">Last Week</option>
            <option value="this_month">This Month</option>
            <option value="last_month">Last Month</option>
             <option value="all">All</option>
          </select>
          </form>
          </div>
          <div class="tab padding-bottom-181">
            <div class="centered-div padding-both-50 padding-lr-20p">
                <div class="col-md-3 image-center">
                    <label class="giant-text"><?php echo $user_count ?></label><br>
                        <label class="dark-text margin-top-none font-18">Total # of New users</label>
                </div>
                <div class="col-md-3 image-center">
                    <label class="giant-text"><?php echo $approved_project_count; ?></label><br>
                        <label class="dark-text margin-top-none font-18">Total # of projects approved</label>
                </div>
                <div class="col-md-3 image-center">
                    <label class="giant-text"><?php echo $complete_project_count; ?></label><br>
                        <label class="dark-text margin-top-none font-18">Total # of projects completed</label>
                </div>
                <div class="col-md-3 image-center">
                    <label class="giant-text"><?php echo $complete_article_count; ?></label><br>
                        <label class="dark-text margin-top-none font-18">Total # of articles accepted</label>
                </div>
            </div>

            <ul class="tabs-menu1 div-center" role="tablist">
            <li class="<?php echo $dashboard_type=='accept'?'current1':' '?>  <?php echo !in_array($dashboard_type,array('accept','wait','reject'))?'current1':''?>"><a href="#tab-1">Projects Accepted</a></li>
            <li class="<?php echo $dashboard_type=='wait'?'current1':' '?>"><a href="#tab-2">New Projects Awaiting Approval</a></li>
            <li class="<?php echo $dashboard_type=='reject'?'current1':' '?>"><a href="#tab-3">Projects Rejected</a></li>
            </ul>


            <div class="tab-content1 <?php echo $dashboard_type=='accept'?'current1':' ' ?> <?php echo !in_array($dashboard_type,array('accept','wait','reject'))?'current1':'display-none'?>" id="tab-1"> <!--current projects -->
                <div class="div-center table-responsive padding-side-19 padding-bottom-100">

                    <table class="table table-bordered padding-bottom-20 background-4-tablist">
                        <thead>
                            <tr class="row text-center">
                                <th class="padding-left-9">DATE ACCEPTED</th>
                                <th class="padding-left-9">PROJECT NAME</th>
                                <th class="padding-left-9">BUYER NAME</th>
                                <th class="text-center">AMOUNT</th>
                            </tr>
                        </thead>
                        <tbody> 
                        <?php foreach($get_approved_project_list as $row)
                        {
                        $p_date=strtotime($row->p_submitdate);
                        ?> 
                            <tr class="row text-center">
                                <td class="col-md-3 info_1"><?php echo date('d-m-y',$p_date); ?></td>
                                <td class="col-md-3 info_1"><?php echo $row->p_title; ?></td>
                                <td class="col-md-3 info_1"><?php echo $row->p_buyname; ?></td>
                                <td class="col-md-3 info_1 text-center"><?php echo $row->p_totalpri; ?></td>
                            </tr>
                        <?php } ?>

                        </tbody>

                    </table><?php echo $links;  ?>
          <!--<b>Approved project List:<br>-->
                </div>
            </div>

            <div class="tab-content1  <?php echo $dashboard_type=='wait'?'current1':' display-none '?>" id="tab-2"> <!--older projects -->      
                <div class="div-center table-responsive padding-side-19 padding-bottom-100">

                    <table class="table table-bordered padding-bottom-20 background-4-tablist">
                        <thead>
                            <tr class="row text-center">
                                <th class="padding-left-9">DATE POSTED</th>
                                <th class="padding-left-9">TIME POSTED</th>
                                <th class="padding-left-9">PROJECT NAME</th>
                                <th class="text-center">USERNAME</th>
                                <th class="text-center">CATEGORY</th>
                                <th class="text-center">AMOUNT</th>
                                <th class="text-center">VIEW</th>
                            </tr>
                        </thead>
                        <tbody>             
                        <?php foreach($get_notapproved_project_list as $row)
                        { 
                        $p_date_time=strtotime($row->p_submitdate);
                        ?>
                            <tr class="row text-center">
                                <td class="col-md-3 info_1"><?php echo date('d-m-y',$p_date_time); ?></td>
                                <td class="col-md-3 info_1"><?php echo date('h:m:s',$p_date_time); ?></td>
                                <td class="col-md-3 info_1"><?php echo $row->p_title; ?></td>
                                <td class="col-md-3 info_1 text-center"><?php echo $row->p_buyname; ?></td>
                                <td class="col-md-5 info_1 text-center"><?php echo $row->p_cat ?></td>
                                <td class="col-md-5 info_1 text-center"><?php echo $row->p_totalpri; ?></td>
                                <td class="col-md-5 info_1 text-center"><a href="<?php echo site_url('admin/dashboard/view/'.$row->p_id);?>" data-toggle="modal" data-target="#baseModal-med" data-backdrop="static"><img src="<?php echo site_url('img/eye.png') ?>"></a></td>
                            </tr>
                        <?php } ?>
                        </tbody>
                    </table><?php echo $links3; ?>
                </div>
            </div>
          <!--<b>Not approved project List:<br>-->


           <div class="tab-content1  <?php echo $dashboard_type=='reject'?'current1':'display-none '?>" id="tab-3"> <!--rejected projects -->       
                <div class="div-center table-responsive padding-side-19 padding-bottom-100">

                    <table class="table table-bordered padding-bottom-20 background-4-tablist">
                        <thead>
                            <tr class="row text-center">
                                <th class="padding-left-9">DATE POSTED</th>
                                <th class="padding-left-9">TIME POSTED</th>
                                <th class="padding-left-9">PROJECT NAME</th>
                                <th class="text-center">USERNAME</th>
                                <th class="text-center">CATEGORY</th>
                                <th class="text-center">AMOUNT</th>
                                <th class="text-center">VIEW</th>
                            </tr>
                        </thead>
                        <tbody>             
                        <?php foreach($get_admin_rejected_proj_list as $row)
                        { 
                        $p_date_time=strtotime($row->p_submitdate);
                        ?>
                            <tr class="row text-center">
                                <td class="col-md-3 info_1"><?php echo date('d-m-y',$p_date_time); ?></td>
                                <td class="col-md-3 info_1"><?php echo date('h:m:s',$p_date_time); ?></td>
                                <td class="col-md-3 info_1"><?php echo $row->p_title; ?></td>
                                <td class="col-md-3 info_1 text-center"><?php echo $row->p_buyname; ?></td>
                                <td class="col-md-5 info_1 text-center"><?php echo $row->p_cat; ?></td>
                                <td class="col-md-5 info_1 text-center"><?php echo $row->p_totalpri; ?></td>
                                <td class="col-md-5 info_1 text-center"><a href="<?php echo site_url('admin/dashboard/view/'.$row->p_id);?>" data-toggle="modal" data-target="#baseModal-med" data-backdrop="static"><img src="<?php echo site_url('img/eye.png') ?>"></a></td>

                            </tr>
                        <?php } ?>
                        </tbody>
                    </table><?php echo $links2;?>
                </div>
            </div>

          </div>

任何人都可以帮我修复此错误。 如果帖子没有直接到达那一点,我很抱歉。

0 个答案:

没有答案