[ PHPXref.com ] [ Generated: Sun Jul 20 19:30:10 2008 ] [ Photo Organizer 2.30 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/src/ -> photo.submission.edit.php (source)

   1  <?php
   2  
   3  //  Copyright (C) 2002, 2003, 2004, 2005, 2006 Balint Kis (balint@k-i-s.net)
   4  
   5  //  This program is free software; you can redistribute it and/or modify
   6  //  it under the terms of the GNU General Public License as published by
   7  //  the Free Software Foundation; either version 2 of the License, or
   8  //  (at your option) any later version.
   9  
  10  //  This program is distributed in the hope that it will be useful,
  11  //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12  //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13  //  GNU General Public License for more details.
  14  
  15  //  You should have received a copy of the GNU General Public License
  16  //  along with this program; if not, write to the Free Software
  17  //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  18  
  19  include_once  "include/vars.php";
  20  include_once  "include/config.php";
  21  include_once "$theme/theme.php";
  22  
  23  $session_id = $_COOKIE[$po_cookie];
  24  if ($session_id == "") {
  25    header("location: login.php");
  26    exit();
  27  }
  28  
  29  include_once  "include/common.php";
  30  include_once  "include/site.php";
  31  include_once  "include/database.php";
  32  
  33  $database = po_dbconnect();
  34  $my_user_id = pg_fetch_row(pg_query($database, "select identifier, type from users where session_id='$session_id'"));
  35  if ($my_user_id[1] < $user_type['user']) {
  36    pg_close($database);
  37    header("location: login.php");
  38    exit();
  39  }
  40  
  41  $submission_id   = $_REQUEST['submission'];
  42  $submission_data = pg_fetch_row(pg_query($database, "select photo_dupe, users, status, date_of_creation, remark
  43                                                         from submission where identifier=$submission_id"));
  44  
  45  /* this will enable administrators to empty anybody's trash */
  46  if ($my_user_id[1] == $user_type['administrator']) {
  47    $tmp_data = pg_fetch_row(pg_query($database, "select photo.users from photo, photo_dupe where photo.identifier=photo_dupe.photo and photo_dupe.identifier=$submission_data[0]"));
  48    $user_id = $tmp_data[0];
  49  }
  50  if (!$user_id) {
  51    $user_id = $my_user_id[0];
  52  }
  53  
  54  $photo_data = pg_fetch_row(pg_query($database, "
  55    select photo.identifier, photo.caption, medium_image_path, large_image_path, hide_original, title
  56      from photo, photo_dupe, photo_version
  57     where photo.identifier = photo_version.photo
  58       and photo.identifier = photo_dupe.photo
  59       and photo_version.master = 't'
  60       and photo_dupe.identifier = $submission_data[0]"));
  61  if ($photo_data == "") {
  62    pg_close($database);
  63    header("location: login.php");
  64    exit();
  65  }
  66  $folder_data = pg_fetch_row(pg_query($database, "select folder.identifier, folder.caption from photo, folder where photo.folder = folder.identifier and photo.identifier='$photo_data[0]'"));
  67  $user_data = pg_fetch_row(pg_query($database, "select identifier, last_name, first_name  from users where identifier=$user_id"));
  68  $client_all = pg_query($database, "select client, last_name, first_name from view_client where users=$user_id and (status=2 or status=4)");
  69  $submission_status_all = pg_query($database, "select identifier, value from submission_status");
  70  
  71  
  72  site_header($page_width, "Edit Photo Submission");
  73  if ($my_user_id[0] == $user_id) {
  74    site_navigator(5, $my_user_id[1]);
  75    $user_display_string = "My Folders and Albums";
  76  }
  77  else {
  78    site_navigator(1, $my_user_id[1]);
  79    $user_display_string = sprintf("%s, %s", $user_data[1], $user_data[2]);
  80  }
  81  $path_to_folder = get_path_to_folder($database, $folder_data[0]);
  82  $title = get_photo_title($photo_data[1], $photo_data[5]);
  83  site_navigator_staus("<a href=\"user.php\">Users</a> : <a href=\"user.php?user=$user_data[0]\">$user_display_string</a>$path_to_folder : <a href=\"folder.php?folder=$folder_data[0]\">$folder_data[1]</a> : <a href=\"photo.php?photo=$photo_data[0]\">$title</a> : Submit this photo", "");
  84  
  85  print "&nbsp;<br/>\n";
  86  print "<center>\n";
  87  display_shaded_photo("image.display.php?image=$photo_data[0]&size=2&ver=$version", "", $image_repository_path . "/" . $photo_data[2]);
  88  print "</center>\n";
  89  print "&nbsp;<br/>\n";
  90  
  91  print "<form method=\"post\" action=\"photo.submission.edit.2.php\">\n";
  92  print "<input type=\"hidden\" name=\"submission\" value=\"$submission_id\">\n";
  93  print "<input type=\"hidden\" name=\"photo\" value=\"$photo_data[0]\">\n";
  94  print "<table bgcolor=\"$color[table_background]\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" width=\"100%\">\n";
  95  print "<tr>";
  96  print "<td align=\"left\" bgcolor=\"$color[table_header]\"  width=\"22%\">Submission date</td>";
  97  print "<td align=\"left\" bgcolor=\"$color[table_header]\"  width=\"18%\">Status</td>";
  98  print "<td align=\"left\" bgcolor=\"$color[table_header]\"  width=\"30%\">Client</td>";
  99  print "<td align=\"left\" bgcolor=\"$color[table_header]\"  width=\"30%\">Remark</td>";
 100  print "</tr>";
 101  
 102  print "<tr>";
 103  print "<td bgcolor=\"$color[table_body]\" >\n";
 104  display_date_input_form("submission_timestamp", substr($submission_data[3], 0, 10));
 105  print "</td>\n";
 106  print "<td bgcolor=\"$color[table_body]\" ><select name=\"submission_status\">";
 107  for ($i = 0; $i < pg_num_rows($submission_status_all); $i++) {
 108    $submission_status = pg_fetch_row($submission_status_all, $i);
 109    if ($submission_status[0] == $submission_data[2])
 110      print "<option value=\"$submission_status[0]\" selected>$submission_status[1]";
 111    else
 112      print "<option value=\"$submission_status[0]\">$submission_status[1]";
 113  }
 114  print "</select></td>\n";
 115  print "<td bgcolor=\"$color[table_body]\" ><select name=\"client\">";
 116  print "<option value=\"null\">None";
 117  for ($i = 0; $i < pg_num_rows($client_all); $i++) {
 118    $client = pg_fetch_row($client_all, $i);
 119    if ($client[2] != "" && $client[1] != "")
 120      $client[2] = $client[2] . ",";
 121    if ($client[0] == $submission_data[1])
 122      print "<option value=\"$client[0]\" selected>$client[2] $client[1]";
 123    else
 124      print "<option value=\"$client[0]\">$client[2] $client[1]";
 125  }
 126  print "</select></td>\n";
 127  print "<td bgcolor=\"$color[table_body]\" ><input type=\"text\" name=\"remark\" value=\"$submission_data[4]\" size=\"30%\"></td>\n";
 128  print "</tr>";
 129  
 130  print "</table>\n";
 131  print "&nbsp;<br/>\n";
 132  print "<input type=\"image\" src=\"$theme/button.save.changes.gif\" border=\"0\" value=\"Save Changes\">\n";
 133  print "<a class=\"nodecor\" href=\"photo.php?photo=$photo_data[0]&detail_info=4\"><img src=\"$theme/button.cancel.gif\" border=\"0\" alt=\"Cancel\"></a>\n";
 134  print "</form>\n";
 135  
 136  print "&nbsp;<br/>\n";
 137  
 138  site_footer($database);
 139  pg_close($database);
 140  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]