Ejemplo n.º 1
0
 public function suggest()
 {
     $this->data['subtitle'] = "Suggest New Chart";
     if ($this->input->post()) {
         if ($this->form_validation->run('suggest_file') == FALSE) {
             $this->content_view = "charts/suggest";
             $this->data['error'] = true;
         } else {
             $this->content_view = "charts/suggest_success";
             $attributes = array("title" => $this->input->post('title'), "artist" => $this->input->post('artist'), "pack" => $this->input->post('pack'), "rate" => $this->input->post('rate'), "chart" => $this->input->post('chart'), "raw_file" => $this->input->post('file'), "file_type" => $this->input->post('file_type'), "user_id" => $this->session->userdata('user_id'));
             $new_announcement = new Suggested_chart($attributes);
             $new_announcement->save();
         }
     } else {
         $this->content_view = "charts/suggest";
     }
 }