function add_project($cid, $uid)
 {
     // auto creating label
     $label = create_label($this->input->post('project_name'));
     // setting up array for project insert
     $new_insert_data = array('cid' => $cid, 'uid' => $uid, 'project_name' => $this->input->post('project_name'), 'label' => $label, 'project_description' => $this->input->post('project_description'), 'created_date' => time());
     // insert into db - projects
     $insert_project = $this->db->insert('projects', $new_insert_data);
     // getting last instered uid from DB
     $project_id = $this->db->insert_id();
     log_message('info', 'Last Project ID: ' . $project_id);
     return $insert_project;
 }
Exemple #2
0
 /**
  * Create boolean widget
  *
  * When creating Yes/No radio buttons, the "yes_text"
  * and "no_text" option attributes are used to override
  * the typical "Yes" and "No" text.
  *
  * @param boolean $checkbox When TRUE, the widget will be
  *                          constructed as a checkbox,
  *                          otherwise it will be a set of
  *                          Yes/No radio buttons (OPTIONAL;
  *                          default is TRUE (checkbox)).
  *
  * @return string html formated boolean widget
  *
  */
 function createWidget_Boolean($checkbox = TRUE)
 {
     global $oTemplate, $nbsp;
     // checkbox...
     //
     if ($checkbox) {
         $result = addCheckbox('new_' . $this->name, $this->value != SMPREF_NO, SMPREF_YES, array_merge(array('id' => 'new_' . $this->name), $this->aExtraAttribs)) . $nbsp . create_label($this->trailing_text, 'new_' . $this->name);
     } else {
         /* Build the yes choice. */
         $yes_option = addRadioBox('new_' . $this->name, $this->value != SMPREF_NO, SMPREF_YES, array_merge(array('id' => 'new_' . $this->name . '_yes'), $this->aExtraAttribs)) . $nbsp . create_label(!empty($this->yes_text) ? $this->yes_text : _("Yes"), 'new_' . $this->name . '_yes');
         /* Build the no choice. */
         $no_option = addRadioBox('new_' . $this->name, $this->value == SMPREF_NO, SMPREF_NO, array_merge(array('id' => 'new_' . $this->name . '_no'), $this->aExtraAttribs)) . $nbsp . create_label(!empty($this->no_text) ? $this->no_text : _("No"), 'new_' . $this->name . '_no');
         /* Build the combined "boolean widget". */
         $result = "{$yes_option}{$nbsp}{$nbsp}{$nbsp}{$nbsp}{$no_option}";
     }
     return $result;
 }