id = $context['id']; $this->db_name = $context['db_name']; $this->config_type = $context['config_type']; } public function set() { global $database; $id = $this->id; $db_name = $this->db_name; $config_type = $this->config_type; if($config_type == "global") { $get_date_format = " SELECT date_format FROM $db_name"."account_settings WHERE account_id = '$id' LIMIT 1 "; $this->date_format = $database->getOne($get_date_format); } else if($config_type == "user") $this->date_format = $_SESSION['settings']['date_format']; } public function form() { $date_format = $this->date_format; ?>
checked="checked" /> Year-Month-Day (2011-01-01)
checked="checked" /> Day-Month-Year (01-01-2011)
checked="checked" /> Day Month Year (01 Jan 2011)
checked="checked" /> Month-Day-Year (01-01-2011)
   
checked="checked" /> Year-Month-Day time (2011-01-01, 4:03pm)
checked="checked" /> Day-Month-Year time (01-01-2011, 4:03pm)
checked="checked" /> Day Month Year time (01 Jan 2011, 4:03pm)
checked="checked" /> Month-Day-Year time (01-01-2011, 4:03pm)
  
 
id; $db_name = $this->db_name; $date_format = mysql_escape_string($_POST['date_format']); $update = " UPDATE $db_name"."account_settings SET date_format = '$date_format' WHERE account_id = '$id' LIMIT 1 "; $results = $database->query($update); if(!$results) { confirmation::error_temp("Change System date Format".$reasons); return false; } else { confirmation::success_temp("Changed System date Format"); return true; } } public function edit_submit_user() { global $database; $db_name = $this->db_name; $user_id = $_SESSION['user']['id']; $date_format = $_POST['date_format']; $database->StartTrans(); $update = " UPDATE $db_name"."users SET date_format = '$date_format' WHERE id = '$user_id' LIMIT 1 "; $results = $database->query($update); logs::submit_logs(array("table" => "users", "action_type" => 2,"foreign_id" => $user_id, "description" => "Modified Date Format")); $results = $database->CompleteTrans(); if(!$results) { confirmation::error_temp("Change your date Format".$reasons); return false; } else { $_SESSION['settings']['date_format'] = $date_format; confirmation::success_temp("Changed your date Format"); return true; } } } ?>