943,172 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 49
  • PHP RSS
Sep 3rd, 2010
0

form values are not storing in the database

Expand Post »
the problem is town and user values is not adding to the database,other than this feilds,other thuings are working down.......
please,give me your suggestions.

//database.php//

<?
/* The Database class is meant to simplify the task of accessing information from the website's database */

include("constants.php");

class MySQLDB
{
var $connection; //The MySQL database connection
var $num_active_users; //Number of active users viewing site
var $num_active_guests; //Number of active guests viewing site
var $num_members; //Number of signed-up users
/* Note: call getNumMembers() to access $num_members! */

/* Class constructor */
function MySQLDB(){

/* Make connection to database */
$this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $this->connection) or die(mysql_error());

/* Only query database to find out number of members when getNumMembers() is called for
the first time, until then, default value set */
$this->num_members = -1;

if(TRACK_VISITORS){

/* Calculate number of users at site */
$this->calcNumActiveUsers();

/* Calculate number of guests at site */
$this->calcNumActiveGuests();
}
}

/* confirmUserPass - Checks whether or not the given username is in the database, if so it checks
if the given password is the same password in the database for that user. If the user doesn't exist
or if the passwords don't match up, it returns an error code (1 or 2). On success it returns userid */
function confirmUserPass($username, $password){

/* Add slashes if necessary (for query) */
if(!get_magic_quotes_gpc()) {
$username = addslashes($username);
}

/* Verify that user is in database */
$q = "SELECT password,userid FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);
if(!$result || (mysql_numrows($result) < 1)){
return 1; //Indicates username failure
}

/* Retrieve password from result, strip slashes */
$dbarray = mysql_fetch_array($result);
//$dbarray['password'] = stripslashes($dbarray['password']);
//$password = stripslashes($password);

/* Validate that password is correct */
if($password == $dbarray['password']){
return 0; //Success! Username and password confirmed
}
else{
return 2; //Indicates password failure
}
}

/* confirmUserID - Checks whether or not the given username is in the database, if so it checks if the
given userid is the same userid in the database for that user. If the user doesn't exist or if the
userids don't match up, it returns an error code (1 or 2). On success it returns 0 */
function confirmUserID($username, $userid){

/* Add slashes if necessary (for query) */
$username = addslashes($username);

/* Verify that user is in database */
$q = "SELECT userid FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);
if(!$result || (mysql_numrows($result) < 1)){
return 1; //Indicates username failure
}

/* Retrieve userid from result, strip slashes */
$dbarray = mysql_fetch_array($result);
//$dbarray['userid'] = stripslashes($dbarray['userid']);
//$userid = stripslashes($userid);

/* Validate that userid is correct */
if($userid == $dbarray['userid']){
return 0; //Success! Username and userid confirmed
}
else{
return 2; //Indicates userid invalid
}
}

/* usernameTaken - Returns true if the username has been taken by another user, false otherwise */
function usernameTaken($username){
$username = addslashes($username);
$q = "SELECT username FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);
return (mysql_numrows($result) > 0);
}

/* usernameTaken - Returns true if the userid has been taken by another user, false otherwise */
function useridTaken($userid){
if(!get_magic_quotes_gpc()){
$userid = addslashes($userid);
}
$q = "SELECT userid FROM ".TBL_USERS." WHERE userid = '$userid'";
$result = mysql_query($q, $this->connection);
return (mysql_numrows($result) > 0);
}

/* usernameBanned - Returns true if the username has been banned by the administrator */
function usernameBanned($username){
$username = addslashes($username);
$q = "SELECT username FROM ".TBL_USERS." WHERE username = '$username' AND banuser = 1";
$result = mysql_query($q, $this->connection);
return (mysql_numrows($result) > 0);
}

/* addNewUser - Inserts the given user info into the database.
Appropriate user level is set. Returns true on success, false otherwise */
function addNewUser($username, $password, $firstname, $lastname, $gender, $dob,
$home, $work, $mobile, $fax, $pager, $homeno, $address1, $address2, $address3,
$state, $pincode, $country, $whomeno, $waddress1, $waddress2, $waddress3,
$wcity, $wpincode, $wcountry, $email, $plist , $langflag){
if(!get_magic_quotes_gpc()){
$username = addslashes($username);
$firstname = addslashes($firstname);
$lastname = addslashes($lastname);
$address1 = addslashes($address1);
$address2 = addslashes($address2);
$address3 = addslashes($address3);
$city = addslashes($city);
$country = addslashes($country);
$waddress1 = addslashes($waddress1);
$waddress2 = addslashes($waddress2);
$waddress3 = addslashes($waddress3);
$wcity = addslashes($wcity);
$wcountry = addslashes($wcountry);
$langflag = addslashes($langflag);


}
$date = getDate();
foreach($date as $item=>$value) {
if ($value < 10)
$date[$item] = "0".$value;
}
$time = $date['year']."-".$date['mon']."-".$date['mday']." ".$date['hours'].":".$date['minutes'].":".$date['seconds'];

/* If admin sign up, give admin user level */
if(strcasecmp($username, ADMIN_NAME) == 0){
$ulevel = ADMIN_LEVEL;
}else{
$ulevel = USER_LEVEL;
}
$n = $firstname." ".$lastname;
$q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '', $ulevel, '$firstname', '$lastname', '$gender', '$dob', '$email', '$time', '$plist', '0','$langflag')";
$res = mysql_query($q, $this->connection);
$id = mysql_insert_id($this->connection);
$q1 = "INSERT INTO ".TBL_USERS_ADDRS." VALUES ('', '$id', '$n', '1', '$homeno', '$address1', '$address2', '$address3', '$city', '$pincode', '$country', '$langflag','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0')";
$res1 = mysql_query($q1, $this->connection);
$q2 = "INSERT INTO ".TBL_USERS_ADDRS." VALUES ('', '$id', '$n', '2', '$whomeno', '$waddress1', '$waddress2', '$waddress3', '$wcity', '$wpincode', '$wcountry', '$langflag','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0')";
$res2 = mysql_query($q2, $this->connection);
$q3 = "INSERT INTO ".TBL_USERS_PHONE." VALUES ('$id','$home', '$work', '$mobile', '$fax', '$pager')";
$res3 = mysql_query($q3, $this->connection);
return $res3;
}

/* add contact messages to contact table */
function addMesg($msgtype, $uname, $uemail, $message){
if(!get_magic_quotes_gpc()){
$msgtype = addslashes($msgtype);
$uname = addslashes($uname);
$uemail = addslashes($uemail);
$message = addslashes($message);
}
$date = getDate();
foreach($date as $item=>$value) {
if ($value < 10)
$date[$item] = "0".$value;
}
$time = $date['year']."-".$date['mon']."-".$date['mday']." ".$date['hours'].":".$date['minutes'].":".$date['seconds'];


$q = "INSERT INTO ".TBL_CONTACT." VALUES ('0','$time','$msgtype','$uname','$uemail','$message')";
$res = mysql_query($q, $this->connection);
return $res;
}

/* add bulletin messages to bulletin table */
function addBulletin($msgtype, $uname, $udob, $uhour, $umin, $place, $sname, $uemail, $message,$subphotoname){
if(!get_magic_quotes_gpc()){
$msgtype = addslashes($msgtype);
$uname = addslashes($uname);
$udob = addslashes($udob);
$uhour = addslashes($uhour);
$umin = addslashes($umin);
$place = addslashes($place);
$sname = addslashes($sname);
$uemail = addslashes($uemail);
$message = addslashes($message);
$subphoto = addslashes($subphotoname);
}
$date = getDate();
foreach($date as $item=>$value) {
if ($value < 10)
$date[$item] = "0".$value;
}
$time = $date['year']."-".$date['mon']."-".$date['mday']." ".$date['hours'].":".$date['minutes'].":".$date['seconds'];


$q = "INSERT INTO ".TBL_BULLETIN." VALUES ('0', '$time', '0', '$msgtype', '$uname', '$udob', '$uhour', '$umin', '$place', '$sname', '$uemail', '$message','$subphotoname')";
$res = mysql_query($q, $this->connection);
$id = mysql_insert_id($this->connection);
return $id;
}


/* updateUserField - Updates a field, specified by the field parameter, in the user's row of the database */
function updateUserField($userid, $field, $value){
if(!get_magic_quotes_gpc()){
$field = addslashes($field);
}
$q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE userid = '$userid'";
return mysql_query($q, $this->connection);
}

/*updateUser - Updates the user data given in edit form*/
function updateUser($userid, $firstname, $lastname, $gender, $dob,$dob1,$dob2,$dob3,$dob4,$dob5,$dob6,$dob7,$dob8,$dob9,$dob10,
$home, $work, $mobile, $fax, $pager, $homeno, $address1, $address2, $address3,
$city, $pincode, $country, $whomeno, $waddress1, $waddress2, $waddress3,
$wcity, $wpincode, $wcountry, $email,$fname,$mname,$wname, $child1, $child2,$child3,$child4,$child5,$child6,$child7,$child8, $plist,$fdob,$bmdob,$wdob,$c1dob,$c3dob,$c4dob,$c5dob,$c6dob,$c7dob,$c8dob){
if(!get_magic_quotes_gpc()){
$firstname = addslashes($firstname);
$lastname = addslashes($lastname);
$address1 = addslashes($address1);
$address2 = addslashes($address2);
$address3 = addslashes($address3);
$city = addslashes($city);
$country = addslashes($country);
$waddress1 = addslashes($waddress1);
$waddress2 = addslashes($waddress2);
$waddress3 = addslashes($waddress3);
$wcity = addslashes($wcity);
$wcountry = addslashes($wcountry);
$fname = addslashes($fname);
$mname = addslashes($mname);
$wname = addslashes($wname);
$child1 = addslashes($child1);
$child2 = addslashes($child2);
$child3 = addslashes($child3);
$child4 = addslashes($child4);
$child5 = addslashes($child5);
$child6 = addslashes($child6);
$child7 = addslashes($child7);
$child8 = addslashes($child8);
$fdob = addslashes($fdob);
$mdob = addslashes($mdob);
$wdob = addslashes($wdob);
$c1dob = addslashes($c1dob);
$c3dob = addslashes($c3dob);
$c4dob = addslashes($c4dob);
$c5dob = addslashes($c5dob);
$c6dob = addslashes($c6dob);
$c7dob = addslashes($c7dob);
$c8dob = addslashes($c8dob);
}
$q = "UPDATE ".TBL_USERS." SET firstname = '$firstname',
lastname = '$lastname', gender = '$gender', dob = '$dob', dob1 = '$dob1',dob2 = '$dob2',dob3 = '$dob3',dob4 = '$dob4',dob5 = '$dob5',dob6 = '$dob6',dob7 = '$dob7',dob8 = '$dob8',dob9 = '$dob9',dob10 = '$dob10',email = '$email', plist ='$plist'
WHERE userid = '$userid'";
$res = mysql_query($q, $this->connection);
$n = $firstname." ".$lastname;
$q1 = "UPDATE ".TBL_USERS_ADDRS." SET name = '$n', type = '1', homeno = '$homeno', address1 = '$address1', address2 = '$address2',
address3 = '$address3', city = '$city', pincode = '$pincode', country = '$country' , fname = '$fname', mname = '$mname', wname = '$wname', child1 = '$child1', child2 = '$child2', child3 = '$child3', child4 = '$child4', child5 = '$child5' , child6 = '$child6',child7 = '$child7',child8 = '$child8',
fdob = '$fdob', mdob = '$mdob', wdob = '$wdob', c1dob = '$c1dob', c3dob = '$c3dob', c4dob = '$c4dob', c5dob = '$c5dob', c6dob = '$c6dob' , c7dob = '$c7dob',c8dob = '$c8dob'
WHERE userid = '$userid' AND type='1'";
$res1 = mysql_query($q1, $this->connection);
$q2 = "UPDATE ".TBL_USERS_ADDRS." SET name = '$n', type = '2', homeno = '$whomeno', address1 = '$waddress1', address2 = '$waddress2',
address3 = '$waddress3', city = '$wcity', pincode = '$wpincode', country = '$wcountry'
WHERE userid = '$userid' AND type='2'";
$res2 = mysql_query($q2, $this->connection);
$q3 = "UPDATE ".TBL_USERS_PHONE." SET home = '$home', work = '$work', mobile = '$mobile',
fax = '$fax', pager = '$pager' WHERE userid = '$userid'";
return mysql_query($q3, $this->connection);
}



/* getUserInfo - Returns the result array from a mysql query asking for all information stored regarding
the given username. If query fails, NULL is returned */
function getUserInfo($username){
$username = addslashes($username);
$q = "SELECT username, password, userid, userlevel, firstname, lastname, gender,
month(dob) dmonth, dayofmonth(dob) dday, year(dob) dyear, email, plist
FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}

/* getUserHomeAddress - Returns the result array from a mysql query asking for home address information stored regarding
the given userid. If query fails, NULL is returned */
function getUserHomeAddress($userid){
$q = "SELECT * FROM ".TBL_USERS_ADDRS." WHERE userid = '$userid' and type='1' and langflag ='T'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}
//english address
function getUserEnglishAddress($userid){
$q = "SELECT * FROM ".TBL_USERS_ADDRS." WHERE userid = '$userid' and type='1'and langflag ='E'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}
//english address
function getUserEnglishAddress1($userid){
$q = "SELECT * FROM ".TBL_USERS_ADDRS." WHERE userid = '$userid' and type='2' and langflag ='E'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}

/* getUserWorkAddress - Returns the result array from a mysql query asking for work address information stored regarding
the given userid. If query fails, NULL is returned */
function getUserWorkAddress($userid){
$q = "SELECT * FROM ".TBL_USERS_ADDRS." WHERE userid = '$userid' and type='2' and langflag ='T'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}
// Testing....address city wise......
function getUserWorkcity($userid){
$q = "SELECT * FROM ".TBL_USERS_ADDRS." WHERE userid = '$userid' and type='1' and pincode ='614616' and langflag ='T'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}

/* getUserPhone - Returns the result array from a mysql query asking for users phone information stored regarding
the given userid. If query fails, NULL is returned */
function getUserPhone($userid){
$q = "SELECT * FROM ".TBL_USERS_PHONE." WHERE userid = '$userid'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given name by default */
if(!$result || (mysql_numrows($result) < 1)){
return NULL;
}
/* Return result array */
$dbarray = mysql_fetch_array($result);
return $dbarray;
}


/* getNumMembers - Returns the number of signed-up users of the website, banned members not included.
The first time the function is called on page load, the database is queried, on subsequent calls,
the stored result is returned. This is to improve efficiency, effectively not querying the database
when no call is made */
function getNumMembers(){
if($this->num_members < 0){
$q = "SELECT * FROM ".TBL_USERS;
$result = mysql_query($q, $this->connection);
$this->num_members = mysql_numrows($result);
}
return $this->num_members;
}
/* calcNumActiveUsers - Finds out how many active users are viewing site and sets class variable accordingly */
function calcNumActiveUsers(){

/* Calculate number of users at site */
$q = "SELECT * FROM ".TBL_ACTIVE_USERS;
$result = mysql_query($q, $this->connection);
$this->num_active_users = mysql_numrows($result);
}

/* calcNumActiveGuests - Finds out how many active guests are viewing site and sets class variable accordingly */
function calcNumActiveGuests(){

/* Calculate number of guests at site */
$q = "SELECT * FROM ".TBL_ACTIVE_GUESTS;
$result = mysql_query($q, $this->connection);
$this->num_active_guests = mysql_numrows($result);
}

/* addActiveUser - Updates username's last active timestamp in the database, and also adds him to the
table of active users, or updates timestamp if already there */
function addActiveUser($username, $time){
$q = "UPDATE ".TBL_USERS." SET timestamp = '$time' WHERE username = '$username'";
mysql_query($q, $this->connection);

if(!TRACK_VISITORS) return;
$q = "REPLACE INTO ".TBL_ACTIVE_USERS." VALUES ('$username', '$time')";
mysql_query($q, $this->connection);
$this->calcNumActiveUsers();
}

/* addActiveGuest - Adds guest to active guests table */
function addActiveGuest($ip, $time){
if(!TRACK_VISITORS) return;
$q = "REPLACE INTO ".TBL_ACTIVE_GUESTS." VALUES ('$ip', '$time')";
mysql_query($q, $this->connection);
$this->calcNumActiveGuests();
}

/* removeActiveUser */
function removeActiveUser($username){
if(!TRACK_VISITORS) return;
$q = "DELETE FROM ".TBL_ACTIVE_USERS." WHERE username = '$username'";
mysql_query($q, $this->connection);
$this->calcNumActiveUsers();
}

/* removeActiveGuest */
function removeActiveGuest($ip){
if(!TRACK_VISITORS) return;
$q = "DELETE FROM ".TBL_ACTIVE_GUESTS." WHERE ip = '$ip'";
mysql_query($q, $this->connection);
$this->calcNumActiveGuests();
}

/* removeInactiveUsers */
function removeInactiveUsers(){
if(!TRACK_VISITORS) return;
$timeout = time()-USER_TIMEOUT*60;
$q = "DELETE FROM ".TBL_ACTIVE_USERS." WHERE timestamp < $timeout";
mysql_query($q, $this->connection);
$this->calcNumActiveUsers();
}

function removeInactiveGuests(){
if(!TRACK_VISITORS) return;
$timeout = time()-GUEST_TIMEOUT*60;
$q = "DELETE FROM ".TBL_ACTIVE_GUESTS." WHERE timestamp < $timeout";
mysql_query($q, $this->connection);
$this->calcNumActiveGuests();
}

/* checkDOB - Checks whether the given Dob is correct for the user.*/
function checkBirth($userid,$dob){
$q = "SELECT * FROM ".TBL_USERS." WHERE userid = '$userid' AND dob = '$dob'";
$result = mysql_query($q, $this->connection);

/* Error occurred, return given 0 */
if(!$result || (mysql_numrows($result) < 1)){
return 0;
}

/* dob match */
return mysql_numrows($result);
}

function addReceipe($resname,$restype,$rescatg,$resing,$resmethod){
if(!get_magic_quotes_gpc()){
$resname = addslashes($resname);
$restype = addslashes($restype);
$rescatg = addslashes($rescatg);
$resing = addslashes($resing);
$resmethod = addslashes($resmethod);
}
$q = "INSERT INTO ".TBL_RECEIPE."(rescp_name,rescp_type,rescp_catg,rescp_ing,rescp_method) VALUES ('$resname','$restype', '$rescatg', '$resing', '$resmethod')";
return mysql_query($q, $this->connection);
}

function addTown($townname,$pincode){
if(!get_magic_quotes_gpc()){
$townname = addslashes($townname);
$pincode = addslashes($pincode);

}
$q = "INSERT INTO ".poovai_townlist."(townname,pincode) VALUES ('$townname','$pincode') ";
return mysql_query($q, $this->connection);

}

function addUser($name,$homeno,$address1,$address2,$address3,$city,$pincode){
if(!get_magic_quotes_gpc()){
$name = addslashes($name);
$homeno = addslashes($homeno);
$address1 = addslashes($address1);
$address2 = addslashes($address2);
$address3 = addslashes($address3);
$city = addslashes($city);
$pincode = addslashes($pincode);
}
$q = "INSERT INTO ".Cust_Address."(name,townid,city,homeno,address1,address2,address3,pincode) VALUES ('$name',(select townid from poovai_townlist where townname='$city'),'$city','$homeno','$address1','$address2','$address3','$pincode')";
return mysql_query($q, $this->connection);
}

function addNews($date1,$newsflag,$newsname,$newscatg,$newsdetail,$imgname,$iwidth,$iheight){
if(!get_magic_quotes_gpc()){
$newsflag = addslashes($newsflag);
$date1 = addslashes($date1);
$newsname = addslashes($newsname);
$newscatg = addslashes($newscatg);
$newsdetail = addslashes($newsdetail);
$imgname = addslashes($imgname);
$iheight = addslashes($iheight);
$iwidth = addslashes($iwidth);
}
$date = getDate();
$newsdate = $date['year']."-".$date['mon']."-".$date['mday'];
$q = "INSERT INTO ".TBL_NEWS."(news_date,news_head,news_catg,news_detail,flag,date,image,image_width,image_height) VALUES ('$newsdate', '$newsname', '$newscatg', '$newsdetail', '$newsflag','$date1', '$imgname', '$iwidth', '$iheight')";
return mysql_query($q, $this->connection);
}

function addResTips($restips){
if(!get_magic_quotes_gpc()){
$restips = addslashes($restips);
}
$q = "INSERT INTO ".TBL_RECEIPE_TIPS."(restips_desc) VALUES ('$restips')";
return mysql_query($q, $this->connection);
}

function addNewWed($subname, $subgender, $subwdob, $subage, $submtongue, $subweight, $subheight, $submstatus, $subreligion, $subsign, $substar, $suboccupation, $subeducation, $subhobby, $subcountry, $subaddress, $subemail, $subtelno, $subphotoname){
if(!get_magic_quotes_gpc()){
$subname = addslashes($subname);
$subgender = addslashes($subgender);
$subwdob = addslashes($subwdob);
$subage = addslashes($subage);
$submtongue = addslashes($submtongue);
$subweight = addslashes($subweight);
$subheight = addslashes($subheight);
$submstatus = addslashes($submstatus);
$subreligion = addslashes($subreligion);
$subsign = addslashes($subsign);
$substar = addslashes($substar);
$suboccupation = addslashes($suboccupation);
$subeducation = addslashes($subeducation);
$subhobby = addslashes($subhobby);
$subcountry = addslashes($subcountry);
$subaddress = addslashes($subaddress);
$subemail = addslashes($subemail);
$subtelno = addslashes($subtelno);
$subphotoname = addslashes($subphotoname);
}

$q = "INSERT INTO ".TBL_WED." VALUES ('', '$subname', '$subgender', '$subwdob', '$subage', '$submtongue', '$subweight', '$subheight', '$submstatus', '$subreligion', '$subsign', '$substar', '$suboccupation', '$subeducation', '$subhobby', '$subcountry', '$subaddress', '$subemail', '$subtelno', '$subphotoname')";
return mysql_query($q, $this->connection);
}

function addNewWedInvit($submfirst,$submname,$subwfirst, $subwname, $subwdob, $subhour, $submin, $subaddress, $subemail, $subtelno, $subphotoname){
if(!get_magic_quotes_gpc()){
$submfirst = addslashes($submfirst);
$submname = addslashes($submname);
$subwfirst = addslashes($subwfirst);
$subwname = addslashes($subwname);
$subwdob = addslashes($subwdob);
$subhour = addslashes($subhour);
$submin = addslashes($submin);
$subaddress = addslashes($subaddress);
$subemail = addslashes($subemail);
$subtelno = addslashes($subtelno);
$subphoto = addslashes($subphotoname);
}
$q = "INSERT INTO ".TBL_WED_INVIT." VALUES ('', '$submfirst', '$submname', '$subwfirst','$subwname', '$subwdob', '$subhour', '$submin', '$subaddress', '$subemail', '$subtelno', '$subphotoname')";
return mysql_query($q, $this->connection);
}

/* query - Performs the given query on the database and returns the result, which may be false,
true or a resource identifier */
function query($query){
return mysql_query($query, $this->connection);
}
};

/* Create database connection */
$database = new MySQLDB;

?>

//the form of the above database is adminprocess.php//

<?
/* The AdminProcess class is meant to simplify the task of processing various actions from the
admin center, these deal with member system adjustments */
include("../include/session.php");

class AdminProcess
{
/* Class constructor */
function AdminProcess(){
global $session;

/* Make sure administrator is accessing page */
// if(!$session->isAdmin()){
//header("Location: ../index.php");
// header("Location: ../login.php");
//return;
// }

/* Admin submitted to give user - user level */
if(isset($_POST['userlvl'])){
$this->procUpdateUserLevel();
}

/* Admin submitted to give user - Admin level */
else if(isset($_POST['adminlvl'])){
$this->procUpdateAdminLevel();
}

/* Admin submitted Add user to poovai list form */
else if(isset($_POST['addpl'])){
$this->procAddUserPL();
}

/* Admin submitted remove user from poovai list form */
else if(isset($_POST['removepl'])){
$this->procRemoveUserPL();
}

/* Admin submitted ban user form */
else if(isset($_POST['ban'])){
$this->procBanUser();
}

/* Admin submitted delete banned user form */
else if(isset($_POST['delbu'])){
$this->procDeleteBannedUser();
}

/* Admin submitted to add receipe */
else if(isset($_POST['addrescp'])){
$this->procAddReceipe();
}

/* Admin submitted to add news */
else if(isset($_POST['addnews'])){
$this->procAddNews();
}

/* Admin submitted to update news */
else if(isset($_POST['getnews'])){
$this->procGetNews();
}

/* Admin submitted to add receipe tips */
else if(isset($_POST['addrestips'])){
$this->procAddResTips();
}

/* Admin submitted to upload photos into photo gallery */
else if(isset($_POST['addphoto'])){
$this->procAddPhoto();
}
/*admin submitted to insert new user syed added */
else if(isset($_POST['addTown'])){
$this->procAddTown();
}

/*users added in the Cust_address list syed added*/
else if(isset($_POST['adduser'])){
$this->procAddUser();
}

/* Poovai user asked to print selected members */
else if(isset($_POST['printsel'])){
$this->procPrintSel();
}

/* Poovai user asked to print all the members */
else if(isset($_POST['printall']) || ($_GET['p'] == 1)){
$this->procPrintAll();
}
/* Poovai user asked to print all the Home members */
else if(isset($_POST['printall']) || ($_GET['p'] == 2)){
$this->procPrintAllHome();
}
/* Poovai user asked to print all the Home members */
else if(isset($_POST['printall']) || ($_GET['p'] == 3)){
$this->procPrintAllEnglish();
}
/* Poovai user asked to print all the Home members */
else if(isset($_POST['printall']) || ($_GET['p'] == 4)){
$this->procPrintAllcity();
}

/* Should not get here, redirect to home page */
else{
//header("Location: ../index.php");
header("Location: ../login.php");
}
}

/* procUpdateLevel - the selected users are given admin level*/
function procUpdateUserLevel(){
global $session, $database;

foreach ($_POST['chkbox'] as $row_id){
$database->updateUserField($row_id, "userlevel", 1);
}
header("Location: ".$session->referrer);
}

function procUpdateAdminLevel(){
global $session, $database;

foreach ($_POST['chkbox'] as $row_id){
$database->updateUserField($row_id, "userlevel", 9);
}
header("Location: ".$session->referrer);
}

function procAddUserPL(){
global $session, $database;

foreach ($_POST['chkbox'] as $row_id) {
$database->updateUserField($row_id, "plist", 1);
}
header("Location: ".$session->referrer);
}

function procRemoveUserPL(){
global $session, $database;

foreach ($_POST['chkbox'] as $row_id) {
$database->updateUserField($row_id, "plist", 0);
}
header("Location: ".$session->referrer);
}

/* procDeleteInactive - All inactive users are deleted from the database, not including
administrators. Inactivity is defined by the number of days specified that have gone
by that the user has not logged in */
function procDeleteInactive(){
global $session, $database;
$inact_time = $session->time - $_POST['inactdays']*24*60*60;
$q = "DELETE FROM ".TBL_USERS." WHERE timestamp < $inact_time "
."AND userlevel != ".ADMIN_LEVEL;
$database->query($q);
header("Location: ".$session->referrer);
}

/* procBanUser - If the submitted username is correct, the user is banned from the member system,
whic ls removing the username from the users table and adding it to the banned users table */
function procBanUser(){
global $session, $database;
foreach ($_POST['chkbox'] as $row_id) {
$database->updateUserField($row_id, "banuser", 1);
$database->query($q);
}
header("Location: ".$session->referrer);
}

/* procDeleteBannedUser - If the submitted username is correct, the user is deleted from the banned
users table, which enables someone to register with that username again */
function procDeleteBannedUser(){
global $session, $database;

/* Delete user from BANNED_USERS database table */
foreach ($_POST['chkbox'] as $row_id) {
$q = "DELETE FROM ".TBL_USERS." WHERE userid = '$row_id'";
$database->query($q);
$q = "DELETE FROM ".TBL_USERS_ADDRS." WHERE userid = '$row_id'";
$database->query($q);
$q = "DELETE FROM ".TBL_USERS_PHONE." WHERE userid = '$row_id'";
$database->query($q);
}
header("Location: ".$session->referrer);
}

/* procAddReceipe - Adds the given receipe to the receipe table */
function procAddReceipe(){
global $session, $database;
$s = $database->addReceipe($_POST['resname'], $_POST['restype'], $_POST['rescatg'], $_POST['resing'], $_POST['resmethod']);
header("Location: ".$session->referrer);
}
/* procAddtown - Adds the townname to the townlist table */
procAddtown - Adds the townname, pincode to the townlist table and sub-town name and pincode to the subtownlist table */
function procAddTown(){
global $session,$database;
$s = $database->addTown($_POST['townname'] , $_POST['pincode']);

if(isset($_POST['subtownname'])){
if($_POST['subtownname']){
$st = $database->addSubTown($_POST['pincode'] , $_POST['subtownname'], $_POST['subtownpincode']);
}
else{
$st=2;
}
}
header("Location:".$session->referrer."?tbl=13&queryR=".$s."&queryRR=".$st);
}



/*procAddUser - Adds the user history in Cust_Address table*/
function procAddUser(){
global $session, $database;
$s = $database->addUser($_POST['name'], $_POST['homeno'], $_POST['address1'], $_POST['address2'], $_POST['address3'], $_POST['city'], $_POST['pincode']);
header("Location:".$session->referrer);
}
/* Add News*/
function procAddNews(){
global $session, $database;

/* echo $_FILES['Image']['tmp_name'];
echo "===========";
echo $_FILES['Image']['name'];
echo "========"; */

if($_FILES['Image']['tmp_name'] != "")
copy ($_FILES['Image']['tmp_name'], "../news/images/".$_FILES['Image']['name']) or die ('Could not upload');
$s = $database->addNews($_POST['date1'],$_POST['newsflag'], $_POST['newsname'], $_POST['newscatg'], $_POST['newsdetail'], $_FILES['Image']['name'], $_POST['iwidth'], $_POST['iheight']);
header("Location: ".$session->referrer);
}


/* Update News*/
function procGetNews(){
global $session, $database;

/* echo $_FILES['Image']['tmp_name'];
echo "===========";
echo $_FILES['Image']['name'];
echo "========"; */
/*modification 3 done below*/
foreach($_POST['newsIdno'] as $news_id) {
$q = "SELECT * FROM ".TBL_NEWS." WHERE newsIdno = '$news_id'";
$database->query($q);
}
header("Location: ".$session->referrer);
}




function procAddPhoto(){
$userfile = $_FILES['userfile']['tmp_name'];
$userfile_name = $_FILES['userfile']['name'];
$userfile_type = $_FILES['userfile']['type'];
$add="../gallery/images/big/$userfile_name"; // the path with the file name where the file will be stored, upload is the directory name.
if(move_uploaded_file ($userfile, $add)){
echo "Successfully uploaded the image";
chmod("$add",0777);

/******* Add the original photo name to the image_order.txt in images/big directory ********/

$file = "../gallery/images/big/image_order.txt";
$fp = fopen($file, "a");
$buf = "\n".$userfile_name;
fwrite($fp, $buf, strlen($buf));
fclose($fp);

/******* Add the thumbnail photo name to the image_order.txt in images directory********/

$file = "../gallery/images/image_order.txt";
$fp = fopen($file, "a");
$buf = "\n".$userfile_name;
fwrite($fp, $buf, strlen($buf));
fclose($fp);
}else{echo "Failed to upload file";
exit;}

///////// Start the thumbnail generation//////////////

$n_width=150; // Fix the width of the thumb nail image
$n_height=100; // Fix the height of the thumb nail image

$tsrc="../gallery/images/$userfile_name"; // Path where thumb nail image will be stored
echo $tsrc;

if (!($userfile_type =="image/pjpeg" OR $userfile_type=="image/gif")){echo "Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>";

exit;}

/////////////////////////////////////////////// Starting of GIF thumb nail creation///////////

if (@$userfile_type=="image/gif")
{
$im=ImageCreateFromGIF($add);
$width=ImageSx($im); // Original picture width is stored
$height=ImageSy($im); // Original picture height is stored
$newimage=imagecreatetruecolor($n_width,$n_height);
imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
if (function_exists("imagegif")) {
Header("Content-type: image/gif");
ImageGIF($newimage,$tsrc);
}

elseif (function_exists("imagejpeg")) {
Header("Content-type: image/jpeg");
ImageJPEG($newimage,$tsrc);
}
chmod("$tsrc",0777);
}////////// end of gif file thumb nail creation//////////

////////////// starting of JPG thumb nail creation//////////

if($userfile_type=="image/pjpeg"){
$im=ImageCreateFromJPEG($add);
$width=ImageSx($im); // Original picture width is stored
$height=ImageSy($im); // Original picture height is stored
$newimage=imagecreatetruecolor($n_width,$n_height);
imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
ImageJpeg($newimage,$tsrc);
chmod("$tsrc",0777);
}
//////////////// End of JPG thumb nail creation //////////
}

/* Add Receipe Tips*/
function procAddResTips(){
global $session, $database;
$s = $database->addResTips($_POST['restips']);
header("Location: ".$session->referrer);
}

/* Print all the selected users */
function procPrintSel(){
global $session, $database;
?>
<table cellpadding="0" cellspacing="0" width="75%" border="0">
<tr>
<td><b>Poovai Community List</b></td>
<td align="right"><a onClick="print()" style="cursor:hand "><img src="../images/printer.jpg" border="0" alt="PRINT THIS LIST">&nbsp;<font face="verdana" size="-1">Print</font></a></td>
</tr>
</table>
<br>
<?
foreach ($_POST['chkbox'] as $row_id){
$q = "SELECT distinct firstname, lastname FROM ".TBL_USERS." WHERE userid = '$row_id'";
$result = $database->query($q);
$row = mysql_fetch_object($result);
$a1 = $database->getUserHomeAddress($row_id);
$a3 = $database->getUserPhone($row_id);
$a2 = $database->getUserWorkAddress($row_id); ?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>

<table cellpadding="0" cellspacing="0" width="85%" border="0">
<tr>
<td align="center"><img src="../images/home.gif"></td>
<td>&nbsp;</td>
<td align="center"><img src="../images/work.gif"></td>
</tr>
<tr>
<td align="left" width="35%">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>
<td valign="top" width="70%" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="1" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td align="center"><table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
<tr><td>&nbsp;</td></tr>
<tr><td><b><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?></font></b></td></tr>
<tr><td><? print($a1['homeno']." ");?><font face="Amudham"><? print ($a1['address1']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a1['address2']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a1['address3']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a1['city']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a1['city'] ." ". $al['pincode']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a1['country']); ?></font></td></tr>
<tr><td align="right"><img src="addresslogo1.gif"></td></tr>
</table>
</td>
<td valign="bottom" width="1" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>
<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
<td width="2%">&nbsp;</td>
<td align="left" width="35%">
<table cellpadding="0" cellspacing="0" align="center" width="100%">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>
<td valign="top" width="70%" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="1" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td align="center">
<table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
<tr><td>&nbsp;</td></tr>
<tr><td><b><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?></font></b></td></tr>
<tr><td><? print($a2['homeno'])." ";?><font face="Amudham"><? print ($a2['address1']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a2['address2']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a2['address3']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a2['city']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a2['city'] ." ". $a2['pincode']); ?></font></td></tr>
<tr><td><font face="Amudham"><? print ($a2['country']); ?></font></td></tr>
<tr><td align="right"><img src="addresslogo1.gif"></td></tr>
</table>
</td>
<td valign="bottom" width="1" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>
<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<? }
}

/* Print all the Poovai Community List Members */
function procPrintAll(){
global $session, $database;
$q = "SELECT * FROM ".TBL_USERS." WHERE plist = 1 and langflag ='T' order by userid";
$result = mysql_query($q); ?>
<STYLE>
P.breakhere { page-break-after: always }
</STYLE>
<table cellpadding="0" cellspacing="0" width="75%" border="0">
<tr>

<td colspan="2"><b><a href="../admin/adminprocess.php?p=2"><img src="../images/h1.gif" border="0"></a>&nbsp;&nbsp;<a href="../admin/adminprocess.php?p=4"><img src="../images/h3.gif" border="0"></a>&nbsp;&nbsp;</b></td>
<td align="right"><a onClick="print()" style="cursor:hand "><img src="../images/printer.jpg" border="0" alt="PRINT THIS LIST">&nbsp;<font face="verdana" size="-1">Print</font></a></td>
</tr>
</table>
<?
$count = 0;
//$actual = 32;
$count1 = 7; ?>
<?
while($row = mysql_fetch_object($result))
{
$a1 = $database->getUserHomeAddress($row->userid);
$a3 = $database->getUserPhone($row->userid);
$a2 = $database->getUserWorkAddress($row->userid); ?>
<? if($count > 4) { ?>
<p CLASS="breakhere">
<?
$count = 0;
}
else ?>
<p>
<? $count++; ?>
<table cellpadding="0" cellspacing="0" width="85%" border="0">
<tr>
<td align="center"><img src="../images/home.gif"></td>
<td>&nbsp;</td>
<td align="center"><img src="../images/work.gif"></td>
</tr>
<tr>
<td align="left" width="35%">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>

<td width="70%" valign="top" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>

<td align="center">
<table width="90%" height="0%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10%" colspan="2"><strong><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?><? print (" mth;fs;"); ?></font></strong></td>
</tr>
<tr>
<td height="10%" colspan="2"><? print($a1['homeno']." ");?><font face="Amudham"><? print ($a1['address1']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><font face="Amudham"><? print ($a1['address2']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><font face="Amudham"><? print ($a1['address3']); ?></font></td>
</tr>
<tr>
<td height="10%"><font face="Amudham"><? print ($a1['city'] ." ". $a1['pincode']); ?></font>Phone:<? print ($a3['home']); ?></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<tr>
<td height="10%" colspan="2">Mobile:<? print ($a3['mobile']); ?>
</td>
</tr>
<?

if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?

if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td height="10%">&nbsp;</td>
<td height="10%">&nbsp;</td>
</tr>
<?
} ?>
<? $count1 = $count1+12; ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>

<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
<td width="2%">&nbsp;</td>
<td align="left" width="35%">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>
<td valign="top" width="70%" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td align="center"><table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
<tr>
<td colspan="2"><strong><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?><? print (" mth;fs;"); ?></font></strong></td>
</tr>
<tr>
<td colspan="2"><? print($a2['homeno'])." ";?><font face="Amudham"><? print ($a2['address1']); ?></font></td>
</tr>
<tr>
<td colspan="2"><font face="Amudham"><? print ($a2['address2']); ?></font></td>
</tr>
<tr>
<td colspan="2"><font face="Amudham"><? print ($a2['address3']); ?></font></td>
</tr>
<tr>
<td><font face="Amudham"><? print ($a2['city'] ." ". $a2['pincode']); ?></font>Phone:<? print ($a3['home']); ?></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<tr>
<td height="10%" colspan="2">Mobile:<? print ($a3['mobile']); ?></td>
</tr>
<? if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}


if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td width="75%" height="10%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<?
} ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>
<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>

<? if($count == 4) ?>
</p>


<br>
<? }
}

function procPrintAllEnglish(){
global $session, $database;
$q = "SELECT * FROM ".TBL_USERS." WHERE plist = 1 and langflag ='E' order by userid";
$result = mysql_query($q); ?>
<STYLE>
P.breakhere { page-break-after: always }
</STYLE>
<table cellpadding="0" cellspacing="0" width="75%" border="0">
<tr>

<td colspan="2"><b><a href="../admin/adminprocess.php?p=2"><img src="../images/h1.gif" border="0"></a>&nbsp;&nbsp;<a href="../admin/adminprocess.php?p=3"><img src="../images/h3.gif" border="0"></a>&nbsp;&nbsp;</b></td>
<td align="right"><a onClick="print()" style="cursor:hand "><img src="../images/printer.jpg" border="0" alt="PRINT THIS LIST">&nbsp;<font face="verdana" size="-1">Print</font></a></td>
</tr>
</table>
<?
$count = 0;
//$actual = 32;
$count1 = 7; ?>
<?
while($row = mysql_fetch_object($result))
{
$a1 = $database->getUserEnglishAddress($row->userid);
$a2 = $database->getUserEnglishAddress($row->userid); ?>
<? if($count > 4) { ?>
<p CLASS="breakhere">
<?
$count = 0;
}
else ?>
<p>
<? $count++; ?>
<table cellpadding="0" cellspacing="0" width="85%" border="0">
<tr>
<td align="center"><img src="../images/home.gif"></td>
<td>&nbsp;</td>
<td align="center"><img src="../images/work.gif"></td>
</tr>
<tr>
<td align="left" width="35%">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>

<td width="70%" valign="top" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>

<td align="center">
<table width="90%" height="0%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10%" colspan="2"><strong><? print($row->lastname); ?><? print (" " . $row->firstname); ?></font></strong></td>
</tr>
<tr>
<td height="10%" colspan="2"><? print($a1['homeno']." ");?><? print ($a1['address1']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><? print ($a1['address2']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><? print ($a1['address3']); ?></font></td>
</tr>
<tr>
<td height="10%"><? print ($a1['city'] ." ". $a1['pincode']); ?></font></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<?

if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?

if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td height="10%">&nbsp;</td>
<td height="10%">&nbsp;</td>
</tr>
<?
} ?>
<? $count1 = $count1+12; ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>

<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
<td width="2%">&nbsp;</td>
<td align="left" width="35%">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>
<td valign="top" width="70%" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td align="center"><table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
<tr>
<td colspan="2"><strong><? print($row->lastname); ?><? print (" " . $row->firstname); ?></font></strong></td>
</tr>
<tr>
<td colspan="2"><? print($a2['homeno'])." ";?><? print ($a2['address1']); ?></font></td>
</tr>
<tr>
<td colspan="2"><? print ($a2['address2']); ?></font></td>
</tr>
<tr>
<td colspan="2"><? print ($a2['address3']); ?></font></td>
</tr>
<tr>
<td><? print ($a2['city'] ." ". $a2['pincode']); ?></font></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<? if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}


if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td width="75%" height="10%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<?
} ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>
<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>

<? if($count == 4) ?>
</p>


<br>
<? }
}
function procPrintAllcity(){
global $session, $database;
$q = "SELECT * FROM ".TBL_USERS." WHERE plist = 1 and langflag ='T' order by userid";
$result = mysql_query($q); ?>
<STYLE>
P.breakhere { page-break-after: always }
</STYLE>
<table cellpadding="0" cellspacing="0" width="75%" border="0">
<tr>

<td colspan="2"><b><a href="../admin/adminprocess.php?p=2"><img src="../images/h1.gif" border="0"></a>&nbsp;&nbsp;<a href="../admin/adminprocess.php?p=3"><img src="../images/h3.gif" border="0"></a>&nbsp;&nbsp;</b></td>
<td align="right"><a onClick="print()" style="cursor:hand "><img src="../images/printer.jpg" border="0" alt="PRINT THIS LIST">&nbsp;<font face="verdana" size="-1">Print</font></a></td>
</tr>
</table>
<?
$count = 0;
//$actual = 32;
$count1 = 7; ?>
<?
while($row = mysql_fetch_object($result))
{
$a1 = $database->getUsercityAddress($row->userid);
$a2 = $database->getUsercityAddress($row->userid); ?>
<? if($count > 4) { ?>
<p CLASS="breakhere">
<?
$count = 0;
}
else ?>
<p>
<? $count++; ?>
<table cellpadding="0" cellspacing="0" width="85%" border="0">
<tr>
<td align="center"><img src="../images/home.gif"></td>
<td>&nbsp;</td>
<td align="center"><img src="../images/work.gif"></td>
</tr>
<tr>
<td align="left" width="35%">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>

<td width="70%" valign="top" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>

<td align="center">
<table width="90%" height="0%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10%" colspan="2"><strong><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?></font></strong></td>
</tr>
<tr>
<td height="10%" colspan="2"><? print($a1['homeno']." ");?><font face="Amudham"><? print ($a1['address1']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><font face="Amudham"><? print ($a1['address2']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><font face="Amudham"><? print ($a1['address3']); ?></font></td>
</tr>
<tr>
<td height="10%"><font face="Amudham"><? print ($a1['city'] ." ". $a1['pincode']); ?></font></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<?

if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?

if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td height="10%">&nbsp;</td>
<td height="10%">&nbsp;</td>
</tr>
<?
} ?>
<? $count1 = $count1+12; ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>

<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
<td width="2%">&nbsp;</td>
<td align="left" width="35%">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>
<td valign="top" width="70%" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td align="center"><table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
<tr>
<td colspan="2"><strong><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?></font></strong></td>
</tr>
<tr>
<td colspan="2"><? print($a2['homeno'])." ";?><font face="Amudham"><? print ($a2['address1']); ?></font></td>
</tr>
<tr>
<td colspan="2"><font face="Amudham"><? print ($a2['address2']); ?></font></td>
</tr>
<tr>
<td colspan="2"><font face="Amudham"><? print ($a2['address3']); ?></font></td>
</tr>
<tr>
<td><font face="Amudham"><? print ($a2['city'] ." ". $a2['pincode']); ?></font></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<? if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}


if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td width="75%" height="10%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<?
} ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>
<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>

<? if($count == 4) ?>
</p>


<br>
<? }
}


/* Print all the Poovai Community Home List Members */
function procPrintAllHome(){
global $session, $database;
$q = "SELECT * FROM ".TBL_USERS." WHERE plist = 1 and langflag ='T' order by userid";
$result = mysql_query($q); ?>
<STYLE>
P.breakhere { page-break-after: always }
</STYLE>
<table cellpadding="0" cellspacing="0" width="75%" border="0">
<tr>

<td colspan="2"><b><a href="../admin/adminprocess.php?p=1"><img src="../images/h2.gif" border="0"></a>&nbsp;&nbsp;&nbsp;<a href="../admin/adminprocess.php?p=3"><img src="../images/h3.gif" border="0"></a></b></td>
<td align="right"><a onClick="print()" style="cursor:hand "><img src="../images/printer.jpg" border="0" alt="PRINT THIS LIST">&nbsp;<font face="verdana" size="-1">Print</font></a></td>
</tr>
</table>


<?
$count2 = 0;
$count3 = 1;
//$actual = 32;
//$count1 = 7; ?>

<?
while($row = mysql_fetch_object($result))
{


$a1 = $database->getUserHomeAddress($row->userid);
$a2 = $database->getUserWorkAddress($row->userid);
$a3 = $database->getUserPhone($row->userid);?>
<? if($count2 > 4) { ?>
<p CLASS="breakhere">
<?
$count2 = 0;


}
else ?>

<p>

<?

?>
<? if($count3%2 != 0) { ?>
<table cellpadding="0" cellspacing="0" width="85%" border="0">
<tr>
<td align="center"><img src="../images/home.gif"></td>
<td>&nbsp;</td>
<td align="center"><img src="../images/home.gif"></td>
</tr>
<tr>
<td align="left" width="35%">

<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>

<td width="70%" valign="top" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>

<td align="center">
<table width="90%" height="0%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10%" colspan="2"><strong><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?><? print (" mth;fs;"); ?></font></strong></td>
</tr>
<tr>
<td height="10%" colspan="2"><? print($a1['homeno']." ");?><font face="Amudham"><? print ($a1['address1']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><font face="Amudham"><? print ($a1['address2']); ?></font></td>
</tr>
<tr>
<td height="10%" colspan="2"><font face="Amudham"><? print ($a1['address3']); ?></font></td>
</tr>
<tr>
<td height="10%"><font face="Amudham"><? print ($a1['city'] ." ". $a1['pincode']); ?></font>Phone:<font face="Amudham"><? print ($a3['home']); ?></font></td>
<td align="right"><img src="addresslogo1.gif"></td>
</tr>
<tr>
<td height="10%" colspan="2"> Mobile: <? print ($a3['mobile']); ?></td>
</tr>
<?

if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?

if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td height="10%">&nbsp;</td>
<td height="10%">&nbsp;</td>
</tr>
<?
} ?>
<? $count1 = $count1+12; ?>
</table>
</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>

<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
</table>
<? } ?>
</td>

<? if($count3%2==0){
$count2++;
?>
<td width="2%">&nbsp;</td>
<td align="left" width="35%">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><img src="../images/lt1.gif" width="5" height="5" border="0" alt=""></td>
<td valign="top" width="70%" style="border-top:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td valign="top"><img src="../images/rt1.gif" width="5" height="5" border="0" alt=""></td>
</tr>
<tr>
<td valign="bottom" width="5" style="border-left:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td align="center"><table cellpadding="0" cellspacing="0" width="90%" align="center" border="0">
<tr>
<td colspan="2"><strong><? print($row->lastname); ?><font face="Amudham"><? print (" " . $row->firstname); ?><? print (" mth;fs;"); ?></font></strong></td>
</tr>
<tr>
<td colspan="2"><? print($a1['homeno'])." ";?><font face="Amudham"><? print ($a1['address1']); ?></font></td>
</tr>
<tr>
<td colspan="2"><font face="Amudham"><? print ($a1['address2']); ?></font></td>
</tr>
<tr>
<td colspan="2"><font face="Amudham"><? print ($a1['address3']); ?></font></td>
</tr>
<tr>
<td><font face="Amudham"><? print ($a1['city'] ." ". $a1['pincode']); ?></font>Phone:<font face="Amudham"><? print ($a3['home']); ?></font></td>
<td><div align="right"><font face="Amudham"><img src="addresslogo1.gif" width="85" height="18"></font></div></td>
</tr>
<tr>
<td height="10%" colspan="2"> Mobile: <? print ($a3['mobile']); ?></td>
</tr>
<? if($a1['address1'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
}


if($a1['address2'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<? if($a1['address3'] == null)
{
?>
<tr>
<td height="10%" colspan="2">&nbsp;</td>
</tr>
<?
} ?>
<?




if($a1['city'] == null)
{
?>
<tr>
<td width="75%" height="10%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<?
} ?>

</table>

</td>
<td valign="bottom" width="10" style="border-right:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td><img src="../images/bl1.gif" width="5" height="5" border="0" alt=""></td>
<td width="100%" style="border-bottom:1px solid #000000;"><img src="../images/spacer.gif" width="1" height="1" border="0"></td>
<td><img src="../images/br1.gif" width="5" height="5" border="0" alt=""></td>
</tr>

</table>



</td>

</tr>

</table>
<? } ?>
<? $count3++;?>
<? if($count == 4) ?>
</p>


<br>
<? }
}

};

/* Initialize process */

$adminprocess = new AdminProcess;
?>

//the form page is admin1.php//


<?
/* This is the Admin Center page. Only administrators are allowed to view this page. This page displays
the database table of users and banned users. Admins can choose to delete specific users, add/delete
user to poovai list, delete inactive users, ban users, update user levels, etc */
include("../include/session.php");

/* displayUsers - Displays the users database table in a nicely formatted html table */
function displayUsers(){
global $database;
if(!$_GET['lvl'])
$_GET['lvl'] = 'userid';
if(!$_GET['how'])
$_GET['how'] = 'ASC';
if(!$_GET['tbl'])
$_GET['tbl'] = 1;

if($_GET['tbl'] == 1 && $_GET['town']=='Y'){
$q = "SELECT townid, townname "
."FROM poovai_townlist ";
}

if($_GET['tbl'] == 1 && $_GET['town'] == ''){
$q = "SELECT userid,username,userlevel,firstname,lastname,email,plist,timestamp "
."FROM ".TBL_USERS." WHERE banuser = '0' ORDER BY " .$_GET['lvl']." " .$_GET['how'];
}
if($_GET['tbl'] == 2)
{
$q = "SELECT userid,username,userlevel,firstname,lastname,email,plist,timestamp "
."FROM ".TBL_USERS." WHERE plist = '1' ORDER BY " .$_GET['lvl']." " .$_GET['how'];
}
if($_GET['tbl'] == 3)
{
?><br>
<center><font color="#006633">
<? echo "Member Total : ".$database->getNumMembers()."<br><br>";
echo "There are $database->num_active_users registered members and ";
echo "$database->num_active_guests guests viewing the site.<br><br>";
?></font>
</center>
<? $q = "SELECT a.userid,b.username,a.userlevel,a.firstname,a.lastname,a.email,a.plist,b.timestamp "
."FROM ".TBL_USERS." a, ".TBL_ACTIVE_USERS." b WHERE a.username = b.username ORDER BY " .$_GET['lvl']." " .$_GET['how'];
}
if($_GET['tbl'] == 4)
{
$q = "SELECT userid,username,userlevel,firstname,lastname,email,plist,timestamp "
."FROM ".TBL_USERS." WHERE banuser = '1' ORDER BY " .$_GET['lvl']." " .$_GET['how'];
}
if(isset($_POST['srch']))
{
$s = trim($_POST['srch']);
$r = trim($_POST['srchsel']);
if($r == 'firstname' OR $r == 'lastname')
$q = "SELECT userid,username,userlevel,firstname,lastname,email,plist,timestamp "
."FROM ".TBL_USERS." WHERE ($r LIKE '$s%')
ORDER BY " .$_GET['lvl'] ." " .$_GET['how'];
}
if($_GET['tbl'] == 9)
{
if($t = 'newsIdno');
$q = "SELECT news_head,news_catg,news_detail " ."FROM ". TBL_NEWS ." WHERE ($t) ORDER BY "
.$_GET['lvl']." " .$_GET['how'];
}
/* Instantiate Page class */
require_once("page.php");
$p = new Pager;

/* Show many results per page? */
$limit = 100;

/* Find the start depending on $_GET['page'] (declared if it's null) */
$start = $p->findStart($limit);


/* Find the number of rows returned from a query*/
$count = mysql_num_rows(mysql_query($q));

/* Find the number of pages based on $count and $limit */
$pages = $p->findPages($count, $limit);

/* Now we use the LIMIT clause to grab a range of rows */
$result = mysql_query($q." LIMIT ".$start.", ".$limit);

/* Now get the page list and echo it */
$pagelist = $p->pageList($_GET['page'], $pages, $_GET['lvl'], $_GET['how'], $_GET['tbl']); ?>
<tr><td align="left" height="35">
<font face="Arial" size="2">
<a href="javascriptetChecked(1,'chkbox[]')">Check All</a>&nbsp;&nbsp;&nbsp;
<a href="javascriptetChecked(0,'chkbox[]')">Clear All</a>
</font>
</td>
<td align="right">
<font face="Arial" size="2"><b>Page(s):</b></font>&nbsp;&nbsp;
<? //print($pagelist);
/* Or a simple "Previous | Next" listing if you don't want the numeric page listing */
$next_prev = $p->nextPrev($_GET['page'], $pages, $_GET['lvl'], $_GET['how']);
echo $next_prev;
?>
</td>
</tr>

<?

if (!isset($_GET['how'])) {
$_GET['how'] = "ASC";
}
if ($_GET['how'] == "ASC") {
$how="DESC";
} elseif ($_GET['how'] == "DESC") {
$how="ASC";
}
?>
<tr><td colspan="2">
<table width="100%" class="style5" cellpadding="0" cellspacing="0"><font size="2">
<tr bgcolor="#B1E0A9" height="25"><td></td>

<?php
if($_GET['town']=='Y') {
?>
<td class="tablecol" align = "left">gjpt[ vz;</td>
<td class="tablecol" align = "left">bgah;</td>
<?
}else {
?>
<td class="tablecol"><a title="Userid" href="<?php echo $_SERVER["PHP_SELF"]."?lvl=userid&amp;how=".$how."&amp;tbl=".$_GET['tbl']?>">gjpt[ vz;</a></td>
<td class="tablecol"><a title="Firstname" href="<?php echo $_SERVER["PHP_SELF"]."?lvl=firstname&amp;how=".$how."&amp;tbl=".$_GET['tbl'] ?>">bgah;</a></td>
<td>&nbsp;</td>
<td><a title="1-User 9-Admin" href="<?php echo $_SERVER["PHP_SELF"]."?lvl=userlevel&amp;how=".$how."&amp;tbl=".$_GET['tbl'] ?>">Level</a></td>
<td><a title="timestamp" href="<?php echo $_SERVER["PHP_SELF"]."?lvl=timestamp&amp;how=".$how."&amp;tbl=".$_GET['tbl'] ?>">Last Active</a></td>
<? } ?>
</tr></font>

<?

if(!$result || ($count < 0)){?>
<tr><td colspan="3" align="center"><font face="Arial">Error Displaying Info.</font></td></tr>
</table>
<? return;
}

if($count == 0){?>
<tr><td colspan="3" align="center"><font face="Arial">No records found.</font></td></tr>
</table>
<? return;
}

$color1 = "#EAF8E7";
$color2 = "#FFFFFF";
$rowcount = 0;

while($row = mysql_fetch_object($result)){

if($_GET['town'] == 'Y') {
$uid = $row->townid;
$townname = $row->townname;

} else {
$uid = $row->userid;
$uname = $row->username;
$ufname = $row->firstname;
$ulname = $row->lastname;
$ulevel = $row->userlevel;
$email = $row->email;
$plist = $row->plist;
$time = $row->timestamp;
}
$row_color = ($rowcount % 2) ? $color1 : $color2;?>

<tr style="border-bottom-color:#CCCCCC" bgcolor="<? echo $row_color;?>" onmouseover="bgColor='#EBEBEB'" onmouseout="bgColor='<? echo $row_color;?>'"><td><input type="checkbox" name="chkbox[]" value="<? echo $uid;?>"></td>

<?php
if($_GET['town'] == 'Y') {
?>
<td align="left" ><? print($uid); ?></td>
<td align="left"><font face = "Amudham"><? print($townname); ?></font></td>


<? } else { ?>

<td align="left"><? print($uid); ?></td>
<td align="left"><font face="Amudham"><? print($ufname); ?></font><? print(" ".$ulname); ?></td>
<td><a class="lineout" onMouseOver="this.className='linein';" onMouseOut="this.className='lineout';" href="userinfo.php?uinfo=<? print $uname;?>"><font face="Times" size="-3" color="#006633">[User Info]</font></a>&nbsp;&nbsp;&nbsp;<a class="lineout" onMouseOver="this.className='linein';" onMouseOut="this.className='lineout';" href="adminuseredit.php?uinfo=<? print $uname;?>"><font face="Times" size="-3" color="#006633">[Edit]</font></a></td>
<td align="center"><? print($ulevel); ?></td>
<td align="center"><? print($time); ?></td>
<? } ?>
</tr>
<? $rowcount++;
}?>
</table>
</td></tr>
<?
}

/* User not an administrator, redirect to home page automatically */
if(!$session->isAdmin()){
header("Location: http://localhost/public_html/index.php");
}
else{

/* Administrator is viewing page, so display all forms */
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
<title>Administrator Page</title>
<link rel="stylesheet" type="text/css" href="../poovaicss.css">
<style>
select{
font-family: Amudham, Arial, sans-serif;
font-size: 100%;
color: #6633FF;
}
</style>
<script language = "Javascript">
<!-- check all/clear all links script. */

var form='frmactions' //Give the form name here

function SetChecked(val,chkName) {
dml=document.forms[form];
len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if (dml.elements[i].name==chkName) {
dml.elements[i].checked=val;
}
}
}

function ValidateForm(dml,chkName){
len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if ((dml.elements[i].name==chkName) && (dml.elements[i].checked==1)) return true
}
alert("Please select at least one record")
return false;
}
// -->

var items = new Array();

items[0] = new Array("Juices", "Icecreams");
items[1] = new Array("Tiffins", "Sweets", "Hots");
items[2] = new Array("Dishes", "Curries", "Sidedishes");
items[3] = new Array("Fish", "Prawn", "Crab", "Chicken", "Mutton", "misc");

function changeItems(){
num=document.frmrescp.restype.options[document.frmrescp.restype.selectedIndex].value;
document.frmrescp.rescatg.options.length = 0;
for(i=0; i<items[num].length; i++){
document.frmrescp.rescatg.options[i] = new Option(items[num][i], items[num][i]);
}
}

function addsubtn()
{
if(document.frmrescp.chkbx.checked==true)
{
<!--document.getElementById('tn').style.visibility="visible";
//document.getElementById('tn').style.visibility="inline";-->
document.getElementById('pnc').style.visibility="visible";
//document.getElementById('pnc').style.visibility="inline";
document.getElementById('stn').style.visibility="visible";
//document.getElementById('stn').style.visibility="inline";
document.getElementById('spnc').style.visibility="visible";
//document.getElementById('spnc').style.visibility="inline";

}
else{
document.getElementById('pnc').style.visibility="visible";
//document.getElementById('pnc').style.visibility="inline";
document.getElementById('pnc').style.visibility="visible";
//document.getElementById('pnc').style.visibility="inline";
document.getElementById('stn').style.visibility="hidden";
//document.getElementById('stn').style.visibility="relative";
document.getElementById('spnc').style.visibility="hidden";
//document.getElementById('spnc').style.visibility="relative";
}

}

function addoffice()
{
if(document.frmrescp.chkbx2.checked==true)
{
document.getElementById('n1').style.visibility="visible";
document.getElementById('sn1').style.visibility="visible";
document.getElementById('tn1').style.visibility="visible";
document.getElementById('s1').style.visibility="visible";
document.getElementById('c1').style.visibility="visible";
document.getElementById('p1').style.visibility="visible";
document.getElementById('pn1').style.visibility="visible";
document.getElementById('mn1').style.visibility="visible";

}
else{
document.getElementById('n1').style.visibility="hidden";
document.getElementById('sn1').style.visibility="hidden";
document.getElementById('tn1').style.visibility="hidden";
document.getElementById('s1').style.visibility="hidden";
document.getElementById('c1').style.visibility="hidden";
document.getElementById('p1').style.visibility="hidden";
document.getElementById('pn1').style.visibility="hidden";
document.getElementById('mn1').style.visibility="hidden";
}

}
function vall()
{
if(document.frmrescp.pincode.value=="")
{
alert("Please enter the ZIPCODE");
}
}
function vall()
{
if(document.frmrescp.pincode1.value=="")
{
alert("Please enter the ZIPCODE");
}
}
function vall()
{
if(document.frmrescp.pincode.value=="")
{
alert("Please enter the PINCODE");
}
}
function vall()
{
if(document.frmrescp.subtownpincode.value=="")
{
alert("Please enter the PINCODE");
}
}
function showAlert(){
alert("Town name is added")
}
function showAlertST(){
alert("Sub-Town name is added")
}

function showAlertFail(){
alert("Town name is already added")
}
function showAlertFailST(){
alert("Sub-Town name is already added")
}
</script>
<script type="text/javascript" src="selectcity.js"></script>
<script type="text/javascript" src="selectcity1.js"></script>

</head>
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" alink="#006633" link="#006644" vlink="#006633" >
<table width="100%" border="0">
<tr>
<td><? include("../Header1.php"); ?></td>


</tr>
</table>



<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td bgcolor="#ff8307" colspan="2" align="left">
<font color="#FFFFFF"><h3>&nbsp;WELCOME ADMIN</h3></font>
&nbsp;&nbsp;&nbsp;<b><font size="3" color="#FFFFFF">Logged in as </font>
<font size="4" face="Amudham" color="#FFFFFF"><? echo $session->username; ?></font></b>
</td>
</tr>
<tr>
<td width="25%" align="center" valign="top" bgcolor="#FFFFFF" height="500">
<br>
<a style="cursor:hand" onClick="keyopen();" onmouseover="document.key_but.src='http://www.poovai.net/images/keybtn_on.gif'" onmouseout="document.key_but.src='http://www.poovai.net/images/keybtn_on.gif'">
<img src="http://www.poovai.net/images/keybtn_on.gif" border="0" alt="KEYBOARD" NAME="key_but">
</a>
<br><br>
<table cellpadding="0" cellspacing="0" width="70%" align="center" border="0" class="style5">
<tr><td valign="top" bgcolor="#FFFFFF">
<table cellpadding="3" cellspacing="0" width="100%">
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="srchform">
<tr>
<td align="left" bgcolor="#ff8307"><div align="center"><font color="#FFFFFF"><strong>§¾¼ø</strong></font></div></td>
</tr>
<tr><td align="center"><select name="srchsel">
<option value="firstname">Firstname</option>
<option value="lastname">Lastname</option>
</select>
</td></tr>
<tr><td valign="middle" align="center"><input name="srch" id="srch" type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="50"></td></tr>
<tr><td align="center"><input type="hidden" name="subsrchbttn" value="1">
<a href="javascript:document.srchform.submit()" onmouseover="document.srchform.srchbttn.src='http://www.poovai.net/images/srchbtn_off.jpg'" onmouseout="document.srchform.srchbttn.src='http://www.poovai.net/images/srchbtn_off.jpg'">
<img src="http://www.poovai.net/images/srchbtn_off.jpg" border="0" alt="SEARCH" NAME="srchbttn">
</a>
</td></tr>
</form>
</table>
</td></tr>
<tr><td background="http://www.poovai.net/images/botmenu.jpg" border="0" height="22"></td></tr>
</table>
<br><br>
<table cellpadding="0" cellspacing="0" width="70%" align="center" border="0" class="style5">
<tr>
<td align="left" bgcolor="#ff8307"><div align="center"><font color="#FFFFFF"><strong>ÀðÊÂø¸û</strong></font></div></td>
</tr>
<tr><td valign="top" bgcolor="#FFFFFF">
<br>
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" width="90%">

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=1" ?>">User List</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=1&town=Y" ?>">Town List</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=2" ?>">Poovai List</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=3" ?>">Current Users</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=4" ?>">Banned Users</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=5" ?>">Add Recipe</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=6" ?>">Add News</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=7" ?>">Add Recipe Tips</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=8" ?>">Add Photo</a></font></td></tr>


<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=9" ?>">Update News</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=10" ?>">Update Recipe</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=11" ?>">Update Recipe Tips</a></font></td></tr>

<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=12" ?>">Update Photo</a></font></td></tr>


<tr><td class="yourclass" onMouseOver="this.className='yourotherclass';" onMouseOut="this.className='yourclass';" align="left"><font face="Arial" size="-1"><a href= "#" onClick="window.open('calendar.php','Max','toolbar=no,status=no,scrollbars=yes,width=800,height=500,resize=yes,left=100,top=50');return false">Admin Calendar</a></font></td></tr>

</table>
</td></tr>
<tr><td background="http://www.poovai.net/images/botmenu.jpg" border="0" height="22"></td></tr>
</table>
<br>
<br>
<font color="#006633">[</font>&nbsp;<a href="http://www.poovai.net/index.php"><font face="Arial" size="-1">Home Page</font></a>&nbsp;<font color="#006633">]</font>
</td>

<td width="75%" bgcolor="#FFFFFF" align="center" valign="top">
<table width="100%">
<tr><td align="left" colspan="2"><font color="#006633" size="+2" >
<? if($_GET['tbl'] == 1 && $_GET['town']=='Y')
{
?><font size=4><?
print("TOWN LIST");
}
else if($_GET['tbl'] == 1)
{
?><font size=4><?
print("USER LIST");
}
else if ($_GET['tbl'] == 2)
{
?><font size=4><?
print("POOVAI LIST");
}
else if($_GET['tbl'] == 3)
{
?><font size=4><?
print("CURRENT USERS");
}
else if($_GET['tbl'] == 4)
{
?><font size=4><?
print("BANNED USERS");
}
else if($_GET['tbl'] == 5)
{
?><font size=4><?
print("ADD RECIPE");
}
else if($_GET['tbl'] == 6)
{
?><font size=4><?
print("ADD NEWS");
}
else if($_GET['tbl'] == 7)
{
?><font size=4><?
print("ADD RECIPE TIPS");
}
else if($_GET['tbl'] == 8)
{
?><font size=4><?
print("PHOTO UPLOAD TO PHOTO GALLERY");
}
else if($_GET['tbl'] == 9)
{
?><font size=4><?
print("UPDATE NEWS");
}
else if($_GET['tbl'] == 10)
{
?><font size=4><?
print("UPDATE RECIPE");
}
else if($_GET['tbl'] == 11)
{
?><font size=4><?
print("UPDATE RECIPE TIPS");
}
else if($_GET['tbl'] == 12)
{
?><font size=4><?
print("PHOTO UPLOAD TO PHOTO GALLERY");
}
else if($_GET['tbl'] == 13)
{
?><font size=4><?
print("ADD TOWN");
}
else if($_GET['tbl'] == 14)
{
?><font size=4><?
print("ADD USER");
}
else
{
?><font size=4><?
print("USER LIST"); $_GET['tbl']=1;
}?>
</font>
<hr color="#DADADA" size="1">
</td></tr>

<? if ($_GET['tbl'] <= 4) { ?>
<form name="frmactions" action="displayaddress.php" method="post" onSubmit="return ValidateForm(this,'chkbox[]')">
<?

if($form->num_errors > 0){
echo "<font size=\"3\" color=\"#ff0000\">"
."!*** Error with request, please fix</font><br><br>";
}
?>
<tr><td bgcolor="#ff8307" height="30" colspan="2">

<?if($_GET['tbl'] == 1 && $_GET['town'] == 'Y'){ ?>


&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="submit" name="Townlist" value="GO TO ADDRESS LIST">
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<font face="Arial" size="2" color="#FF0080"><strong><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=13" ?>">ADD TOWN</a></font>
<? } ?>

<? if($_GET['tbl'] && $_GET['town'] == ''){

switch($_GET['tbl']){
case "1" : ?>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="submit" name="ban" value="BAN USER">&nbsp;&nbsp;
<input type="submit" name="userlvl" value="USER LEVEL">&nbsp;&nbsp;
<input type="submit" name="adminlvl" value="ADMIN LEVEL">&nbsp;&nbsp;&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<font face="Arial" size="2"><strong><a href="<?php echo $_SERVER["PHP_SELF"]."?tbl=14" ?>">ADD USER</a>
</font>
<? break; ?>
<? case "2" :
case "3" : ?> <center><input type="submit" name="ban" value="BAN USER">&nbsp;&nbsp;
<input type="submit" name="userlvl" value="USER LEVEL">&nbsp;&nbsp;
<input type="submit" name="adminlvl" value="ADMIN LEVEL">
<? break; ?>
<? case "4" : ?> <center><input type="submit" name="delbu" value="DELETE" >
<? break; ?>
<? default : ?> <center><input type="submit" name="ban" value="BAN USER">&nbsp;&nbsp;
<input type="submit" name="userlvl" value="USER LEVEL">&nbsp;&nbsp;
<input type="submit" name="adminlvl" value="ADMIN LEVEL">
<? break; ?>

<? }
} ?>
</td></tr>
<?
/* Display Users Table */
displayUsers();
?>
<tr><td bgcolor="#ff8307" height="30" colspan="2">
<?if($_GET['tbl'] == 1 && $_GET['town'] == 'Y'){ ?>
<center><input type="submit" name="Townlist" value="GO TO ADDRESS LIST">
<? } ?>
<? if($_GET['town']!='Y'){
switch($_GET['tbl']){
case "1" :
case "3" : ?> <center><input type="submit" name="addpl" value="ADD TO POOVAI LIST">&nbsp&nbsp
<input type="submit" name="removepl" value="REMOVE FROM POOVAI LIST">
<? break; ?>
<? case "2" : ?> <center><input type="submit" name="removepl" value="REMOVE FROM POOVAI LIST">
<? break; ?>
<? case "4" : ?> <center><input type="submit" name="delbu1" value="DELETE">
<?break; ?>
<? } } ?>
</td></tr>
</form>
<? }
else { ?>
<form name="frmrescp" action="adminprocess.php" method="post" enctype="multipart/form-data">
<?

if($form->num_errors > 0){
echo "<font size=\"3\" color=\"#ff0000\">"
."!*** Error with request, please fix</font><br><br>";
}
?>
<tr><td bgcolor="#ff8307" height="30" colspan="2">
<? if ($_GET['tbl'] == 5){ ?>
<center><input type="submit" name="addrescp" value="ADD RECIPE">&nbsp&nbsp
<input type="submit" name="updaterescp" value="UPDATE RECIPE">&nbsp&nbsp
<input type="submit" name="deleterescp" value="DELETE RECIPE">
<? }
if ($_GET['tbl'] == 6){?>
<center><input type="submit" name="addnews" value="ADD NEWS">

<? }
if ($_GET['tbl'] == 7){?>
<center><input type="submit" name="addrestips" value="ADD RECIPE TIPS">
<? }
if ($_GET['tbl'] == 8){?>
<center><input type="submit" name="addphoto" value="ADD PHOTO">
<? }
if ($_GET['tbl'] == 10){ ?>

<center><input type="submit" name="updaterescp" value="UPDATE RECIPE">&nbsp&nbsp&nbsp
<input type="submit" name="deleterescp" value="DELETE RECIPE">
<? }
if ($_GET['tbl'] == 11){?>
<center><input type="submit" name="addrestips" value="UPDATE RECIPE TIPS">
<? }
if ($_GET['tbl'] == 12){?>
<center><input type="submit" name="addphoto" value="UPDATE PHOTO">
<? }
if ($_GET['tbl'] == 9){?>
<center><input type="submit" name="addnews" value="ADD NEWS">&nbsp&nbsp&nbsp
<input type="submit" name="deletenews" value="DELETE NEWS">
<?}
if ($_GET['tbl'] == 13){?>
<center><input type="hidden" name="subsrchbttn" value="1">
<a href="javascript:document.srchform.submit()" onmouseover="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'" onmouseout="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'">
<img src="http://www.poovai.net/images/enterbtn_off.jpg" border="0" alt="ADD TOWN" name="srchbttn"></a>
<?}
if ($_GET['tbl'] == 14){?>
<center><input type="hidden" name="subsrchbttn" value="1">
<a href="javascript:document.srchform.submit()" onmouseover="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'" onmouseout="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'">
<img src="http://www.poovai.net/images/enterbtn_off.jpg" border="0" alt="ADD USER" name="srchbttn"></a>
<? } ?>

</td></tr>
<tr><td colspan="2">

<? if ($_GET['tbl'] == 5){ ?><br>
<table width="100%">
<tr>
<td width="12%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="25%" align="left"><font color="#006633">Recipe Name</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="resname" tabindex="1"></td>
</tr>
<tr>
<td align="left"><font color="#006633">Recipe Type</font></td>
<td align="left">
<select name="restype" tabindex="2" onChange="changeItems();">
<option value="0">Drinks</option>
<option value="1">Snacks</option>
<option value="2">Veg</option>
<option value="3">Non-Veg</option>
</select>
</td>
</tr>
<tr>
<td align="left"><font color="#006633">Recipe Category</font></td>
<td align="left">
<select name="rescatg" tabindex="3">
<option>Juices</option>
<option>Icecreams</option>
</select>
</td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633"><br><br>Ingredients</font></td>
<td align="left">
<textarea cols="25" rows="5" class="inputbtn" onClick="getname(this)" tabindex="4" name="resing"></textarea>
</td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633"><br><br><br>Method</font></td>
<td align="left">
<textarea cols="25" rows="10" class="inputbtn" onClick="getname(this)" tabindex="5" name="resmethod"></textarea>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 6){ ?>
<br>
<table width="100%">
<tr>
<td width="8%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="25%" align="left"><font color="#006633">News Flag</font></td>
<td width="75%" align="left"><input type="text" size="1" maxlength="1" name="newsflag" tabindex="1"><font color="#006633">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Function Date &nbsp&nbsp</font><input type="text" size="10" maxlength="10" name="date1" tabindex="1" title="YYYY-MM-DD"><font color="#006633">&nbsp (YYYY-MM-DD)</font></td>
</tr>
<tr>
<td width="25%" align="left"><font color="#006633">News Heading</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="25" maxlength="30" name="newsname" tabindex="2"></td>
</tr>
<tr>
<td align="left"><font color="#006633">News Category</font></td>
<td align="left">
<select name="newscatg" tabindex="3">
<option>News</option>
<option>Generalnews</option>
<option>Interview</option>
<option>Function</option>
<option>Successor</option>
<option>Flash News</option>
<option>Tips</option>
<option>Health</option>
<option>Computer</option>
<option>Poem</option>
<option>Story</option>
<option>History</option>
<option>Oldman</option>

</select>
</td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633"><br><br><br>News Detail</font></td>
<td align="left">
<textarea cols="30" rows="10" class="inputbtn" onClick="getname(this)" tabindex="4" name="newsdetail"></textarea>
</td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633">News Image</font></td>
<td align="left"><input type="file" name="Image" size="20" maxlength="100" tabindex="5"></td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633">Image size</font></td>
<td align="left" valign="top"><font color="#006633">Width &nbsp&nbsp</font><input type="text" name="iwidth" size="3" maxlength="3" tabindex="6">&nbsp&nbsp&nbsp&nbsp<font color="#006633"> Height &nbsp&nbsp</font><input type="text" name="iheight" size="3" maxlength="3" tabindex="7"></td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 7){ ?><br>
<table width="100%">
<tr>
<td width="12%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top"><font color="#006633"><br><br><br>Recipe Tips</font></td>
<td align="left">
<textarea cols="25" rows="10" class="inputbtn" onClick="getname(this)" tabindex="5" name="restips"></textarea>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 8){ ?><br>
<table width="100%">
<tr>
<td width="12%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td align="left"><font color="#006633">Upload This Photo</font></td>
<td align="left">
<input name="userfile" type="file" maxlength="100" size="35">
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 11){ ?><br>
<table width="100%">
<tr>
<td width="12%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top"><font color="#006633"><br><br><br>Recipe Tips</font></td>
<td align="left">
<textarea cols="25" rows="10" class="inputbtn" onClick="getname(this)" tabindex="5" name="restips"></textarea>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 9){ ?><br>
<table width="100%">
<tr>
<td width="10%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="25%" align="left"><font color="#006633">News Id No.</font></td>
<td width="75%" align="left"><input type="text" size="5" maxlength="10" name="newsIdno" tabindex="1"><font color="#006633">&nbsp&nbsp&nbsp&nbsp Function Date</font>&nbsp&nbsp<input type="text" size="10" maxlength="10" name="date1" tabindex="1" title="YYYY-MM-DD"><font color="#006633"> (YYYY-MM-DD)</font></td>
</td>
</tr>
<tr>

<td width="25%" align="left"><font color="#006633">Get News</font></td>
<td width="75%" align="left">

<input type="submit" size="10"
maxlength="20" name="getnews" tabindex="1" value="GET">

</td></tr>


<tr>
<td width="25%" align="left"><font color="#006633">News Name</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="newsname(this)" size="20" maxlength="20" name="newsname" tabindex="2"></td>
</tr>

<tr>
<td width="25%" align="left"><font color="#006633">News Heading</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="30" maxlength="100" name="newsname" tabindex="2"></td>
</tr>

<tr>



<tr>
<td align="left" valign="top"><font color="#006633"><br><br><br>News Detail</font></td>
<td align="left">
<textarea cols="30" rows="10" class="inputbtn" onClick="getname(this)" tabindex="4" name="newsdetail"></textarea>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 10){ ?><br>
<table width="100%">
<tr>
<td width="15%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="25%" align="left"><font color="#006633">Recipe Name</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="resname" tabindex="1"></td>
</tr>

<td width="25%" align="left"><font color="#006633">Get</font></td>
<td width="75%" align="left">

<input type="button" size="10"
maxlength="20" name="get" tabindex="1" value="GET">

</td></tr>
<tr>
<td align="left"><font color="#006633">Recipe Type</font></td>
<td align="left">
<select name="restype" tabindex="2" onChange="changeItems();">
<option value="0">Drinks</option>
<option value="1">Snacks</option>
<option value="2">Veg</option>
<option value="3">Non-Veg</option>
</select>
</td>
</tr>
<tr>
<td align="left"><font color="#006633">Recipe Category</font></td>
<td align="left">
<select name="rescatg" tabindex="3">
<option>Juices</option>
<option>Icecreams</option>
</select>
</td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633"><br><br>Ingredients</font></td>
<td align="left">
<textarea cols="25" rows="5" class="inputbtn" onClick="getname(this)" tabindex="4" name="resing"></textarea>
</td>
</tr>
<tr>
<td align="left" valign="top"><font color="#006633"><br><br><br>Method</font></td>
<td align="left">
<textarea cols="25" rows="10" class="inputbtn" onClick="getname(this)" tabindex="5" name="resmethod"></textarea>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 12){ ?><br>
<table width="100%">
<tr>
<td width="10%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<td align="left"><font color="#006633">Upload This Photo</font></td>
<td align="left">
<input name="userfile" type="file" maxlength="100" size="35">
</td>
</tr>
</table>
</td>
</tr>
</table><br>
<? }?>
<? if ($_GET['tbl'] == 13){ ?><br>
<table width="100%">
<tr>
<td width="20%">
<td>
<table cellpadding="5" cellspacing="0" width="100%">
<tr id="tn">
<td width="25%" align="left"><font color="#006633">Town Name</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="townname" tabindex="1"></td>
</tr>
<tr id="pnc">
<td width="25%" align="left"><font color="#006633">Pincode</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="5" maxlength="100" name="pincode" tabindex="1" onBlur="vall()"></td>
</tr>
<tr>
<td width="25%" align="left"></td>
<td width="75%" align="left"><input type="checkbox" class="inputbtn" onClick="addsubtn()" name="chkbx" ><font color="#006633">To add Sub Town</font></td>
</tr>
<tr id ="stn" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Sub Town Name</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="subtownname" tabindex="1"></td>
</tr>
<tr id ="spnc" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Pincode</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="5" maxlength="100" name="subtownpincode" tabindex="1" onBlur="vall()"></td>
</tr>
<? if(isset($_GET['queryR'])){
if($_GET['queryR']){
echo('<script language="javascript">');
echo('show();');
echo('</script>');
}
else{
echo('<script language="javascript">');
echo('showAlertFail();');
echo('</script>');
}
}
if(isset($_GET['queryRR'])){
if(($_GET['queryRR'])==1){
echo('<script language="javascript">');
echo('showAlertST();');
echo('</script>');
}
if(($_GET['queryRR'])==null){
echo('<script language="javascript">');
echo('showAlertFailST();');
echo('</script>');
}
if(($_GET['queryRR'])==2){
echo "";
}
} ?>
</table>
</td>
</tr>
</table><br>
<? }?>

<? if ($_GET['tbl'] == 14){ ?><br>
<table width="100%">
<tr>
<td width="12%">

<td>
<td>
<table cellpadding="5" cellspacing="0" width="100%" >

<tr>
<td width="25%" align="left"></td>
<td width="75%" align="left">
<font color="#006633">
<b><u>HOME</u></b>
</font>
</td>
</tr>
<tr id ="n">
<td width="5" align="left"><font color="#006633">Name</font></td>
<td width="75" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="25" maxlength="100" name="name" tabindex="1"></td>
</tr>
<tr id ="sn">
<td width="25%" align="left"><font color="#006633">Street</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="35" maxlength="100" name="street" tabindex="1"></td>
</tr>
<tr id ="tn">
<td width="25%" align="left"><font color="#006633">Town/City</font></td>
<td width="75%" ><table width="100%"><tr><td width="20%">
<select name="city" class = "tablecol" onchange="showSubTown(this.value)" tabindex="2" >
<?
echo "inside office";
$city = mysql_query("SELECT townname FROM poovai_townlist");
while($row = mysql_fetch_array($city))
{
?>

<option value=<? print $row['townname']; ?>>
<font face="Amudham"><? print $row['townname']; ?></option>
<? } ?>


</select>
</td>
<td width="80%">
<div id="txtHint">
</div>
</td>
</tr>
</table>
</td>
</tr>




<tr id ="s">
<td width="25%" align="left"><font color="#006633">State</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="state" tabindex="1"></td>
</tr>
<tr id ="c">
<td width="25%" align="left"><font color="#006633">Country</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="country" tabindex="1"></td>
</tr>
<tr id ="p">
<td width="25%" align="left"><font color="#006633">Zipcode</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="5" maxlength="100" name="pincode" tabindex="1" onBlur="vall()"></td>
</tr>
<tr id ="pn">
<td width="25%" align="left"><font color="#006633">Phone Number</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="5" maxlength="100" name="phone1" tabindex="1">
<font color="#006633"> - </font>
<input type="text" class="inputbtn" onClick="getname(this)" size="10" maxlength="100" name="phone2" tabindex="1"></td>
</tr>
<tr id ="mn">
<td width="25%" align="left"><font color="#006633">Mobile Number</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="10" maxlength="100" name="mobile" tabindex="1"></td>
</tr>
<tr>
<td width="25%" align="left"></td>
<td width="75%" align="left"><br><input type="checkbox" class="inputbtn" onClick="addoffice()" name="chkbx2"><font color="#006633">OFFICE</font></td>
</tr>
<tr id ="n1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Company Name</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="25" maxlength="100" name="name1" tabindex="1"></td>
</tr>
<tr id ="sn1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Street</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="35" maxlength="100" name="street1" tabindex="1"></td>
</tr>
<tr id ="tn1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Town/City</font></td>
<td width="75%" ><table width="100%"><tr><td width="20%">
<select name="city" class = "tablecol" onchange="showSubTown1(this.value)" tabindex="2" >

<?
echo "inside office";
$city = mysql_query("SELECT townname FROM poovai_townlist");

while($row = mysql_fetch_array($city))
{
?>

<option value=<? print $row['townname']; ?>>
<font face="Amudham"><? print $row['townname']; ?></option>


<? } ?>

</select>
</td>
<td width="80%">
<div id="txtHint1">
</div>
</td>
</tr>
</table>
</td>
</tr>

<tr id ="s1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">State</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="state1" tabindex="1"></td>
</tr>
<tr id ="c1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Country</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="15" maxlength="100" name="country1" tabindex="1"></td>
</tr>
<tr id ="p1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Zipcode</font><font color="#FF0000">*</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="5" maxlength="100" name="pincode1" tabindex="1" onBlur="vall()"></td>
</tr>
<tr id ="pn1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Office Number</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="5" maxlength="100" name="phone1" tabindex="1">
<font color="#006633"> - </font>
<input type="text" class="inputbtn" onClick="getname(this)" size="10" maxlength="100" name="phone2" tabindex="1"></td>
</tr>
<tr id ="mn1" style ="visibility:hidden;">
<td width="25%" align="left"><font color="#006633">Mobile Number</font></td>
<td width="75%" align="left"><input type="text" class="inputbtn" onClick="getname(this)" size="10" maxlength="100" name="mobile1" tabindex="1"></td>
</tr>

<!--tr>
<td align="left">Type</td>
<td align="left">
<select name="type" tabindex="2" onChange="changeItems();">
<option value="0">1</option>
<option value="1">2</option>
</select>
</td>
</tr-->
</table>
</td>
</tr>
</font>
</table><br>
<? }?>

<tr><td bgcolor="#ff8307" height="30" colspan="2">
<? if ($_GET['tbl'] == 5){ ?>
<center><input type="submit" name="addrescp" value="ADD RECIPE">&nbsp&nbsp
<input type="submit" name="updaterescp" value="UPDATE RECIPE">&nbsp&nbsp
<input type="submit" name="deleterescp" value="DELETE RECIPE">
<? }
if ($_GET['tbl'] == 6){?>
<center><input type="submit" name="addnews" value="ADD NEWS">

<? }
if ($_GET['tbl'] == 7){?>
<center><input type="submit" name="addrestips" value="ADD RECIPE TIPS">
<? }
if ($_GET['tbl'] == 8){?>
<center><input type="submit" name="addphoto" value="ADD PHOTO">
<? }
if ($_GET['tbl'] == 9){?>
<center><input type="submit" name="updatenews" value="ADD NEWS">&nbsp&nbsp&nbsp
<input type="submit" name="deletenews" value="DELETE NEWS">
<? }
if ($_GET['tbl'] == 10){ ?>

<center><input type="submit" name="updaterescp" value="UPDATE RECIPE">&nbsp&nbsp&nbsp
<input type="submit" name="deleterescp" value="DELETE RECIPE">
<? }
if ($_GET['tbl'] == 11){?>
<center><input type="submit" name="updaterecipetips" value="UPDATE RECIPE TIPS">
<? }
if ($_GET['tbl'] == 12){?>
<center><input type="submit" name="addphoto" value="UPDATE PHOTO">
<? }
if ($_GET['tbl'] == 13){?>
<center><input type="hidden" name="subsrchbttn" value="1">
<a href="javascript:document.srchform.submit()" onmouseover="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'" onmouseout="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'">
<img src="http://www.poovai.net/images/enterbtn_off.jpg" border="0" alt="ADD" name="srchbttn"></a>
<?}
if ($_GET['tbl'] == 14){?>
<center>
<input type="hidden" name="subsrchbttn" value="1">
<a href="javascript:document.srchform.submit()" onmouseover="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'" onmouseout="document.srchform.srchbttn.src='http://www.poovai.net/images/enterbtn_off.jpg'">
<img src="http://www.poovai.net/images/enterbtn_off.jpg" border="0" alt="ADD" NAME="srchbttn"></a>
<? }
?>


</td></tr>
</form>
<? } ?>
</table>
</td>
</tr>
<tr><td colspan="2"><? include ("footer.php"); ?></td></tr>
</table>
<? require_once("../keyboard.html"); ?>
</body>
</html>
<?
}
?>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
d.jobinraj is offline Offline
2 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: which Framework should i use ??
Next Thread in PHP Forum Timeline: form values are not storing in the database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC