Changeset 331 for trunk/cgi-bin


Ignore:
Timestamp:
04/07/06 18:01:00 (19 years ago)
Author:
Kris Deugau
Message:

/trunk

Basic editing capability for rWHOIS customer contact data.
Still needs segment to allow customization of the Network-Name
field in the rWHOIS data - this is currently only changeable
by manually hacking the database tables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/admin.cgi

    r330 r331  
    304304</form></table>
    305305);
    306   print "<p>Edit existing customer contact data:\n".
     306  print "<p>Click CustID to edit existing customer contact data:\n".
    307307        "<table border=1>\n<tr><td>CustID</td><td>Name</td><td>Tech handle</td></tr>\n";
    308308  $sth = $ip_dbh->prepare("select custid,name,tech_handle from customers order by custid");
    309309  $sth->execute;
    310310  while (my @data = $sth->fetchrow_array) {
    311     print "<tr><td>$data[0]</td><td>$data[1]</td><td>$data[2]</td></tr>\n";
    312   }
     311    print qq(<tr><td><a href="admin.cgi?action=edcust&custid=$data[0]">$data[0]</td>).
     312        "<td>$data[1]</td><td>$data[2]</td></tr>\n";
     313  }
     314  print "</table>\n";
    313315} elsif ($webvar{action} eq 'newcust') {
    314316  if ($webvar{custid} eq '') {
     
    344346    } # $sth err check
    345347  } # bad custid
     348} elsif ($webvar{action} eq 'edcust') {
     349  $sth = $ip_dbh->prepare("select custid,name,street,city,province,".
     350        "country,pocode,phone,tech_handle,abuse_handle,admin_handle ".
     351        "from customers where custid='$webvar{custid}'");
     352  $sth->execute;
     353  my ($custid, $name, $street, $city, $prov, $country, $pocode, $phone, $tech, $abuse, $admin) =
     354        $sth->fetchrow_array;
     355  print qq(<form action=admin.cgi method=POST>
     356<table border=1><tr>
     357<input type=hidden name=action value=updcust>
     358<td>CustID:</td><td>$custid<input type=hidden name=custid value=$custid></td>
     359<td>Name:</td><td><input name=name value="$name"></td></tr>
     360<tr><td>Street:</td><td><input name=street value="$street"></td></tr>
     361<!-- <td>Street2:</td><td><input name=street2></td> -->
     362<tr><td>City:</td><td><input name=city value="$city"></td>
     363<td>Province: (2-letter code)</td><td><input name=province value="$prov" length=2 size=2></td></tr>
     364<tr><td>Country: (2-letter code)</td><td><input name=country value="$country" length=2 size=2></td>
     365<td>Postal/ZIP Code:</td><td><input name=pocode value="$pocode"></td></tr>
     366<tr><td>Phone:</td><td><input name=phone value="$pocode"></td>
     367<!-- <td>Default rDNS:</td><td><input name=def_rdns></td></tr>
     368<td>Description:</td><td><input name=description></td> -->
     369<td>ARIN Handles:</td><td>
     370 Tech: <input name=tech_handle value="$tech"><br>
     371 Abuse: <input name=abuse_handle value="$abuse"><br>
     372 Admin: <input name=admin_handle value="$admin"><br>
     373Note:  Only tech is required at the moment.
     374</td></tr>
     375<tr><td colspan=4 align=center><input type=submit value="Update"></td></tr>
     376</form></table>
     377);
     378
    346379} elsif ($webvar{action} eq 'updcust') {
    347380  print "Updated $webvar{custid}\n";
Note: See TracChangeset for help on using the changeset viewer.