<?php
class zabboweb { // If its not possible, write: return false;
 function birth($day, $month, $year) {
if($month == '1') {
$month = '01'; } 
elseif ($month == '2') {
$month = '02'; } 
elseif ($month == '3') {
$month = '03'; } 
elseif ($month == '4') {
$month = '04'; } 
elseif ($month == '5') {
$month = '05'; } 
elseif ($month == '6') {
$month = '06'; } 
elseif ($month == '7') {
$month = '07'; } 
elseif ($month == '8') {
$month = '08'; } 
elseif ($month == '9') {
$month = '09'; }
if($day == '1') {
$day = '01'; } 
elseif ($day == '2') {
$day = '02'; } 
elseif ($day == '3') {
$day = '03'; } 
elseif ($day == '4') {
$day = '04'; } 
elseif ($day == '5') {
$day = '05'; } 
elseif ($day == '6') {
$day = '06'; } 
elseif ($day == '7') {
$day = '07'; } 
elseif ($day == '8') {
$day = '08'; } 
elseif ($day == '9') {
$day = '09';
}
return $day.$month.$year;
}
   function page($page, $id) {
  $bprofcheck = mysql_query("SELECT * FROM page WHERE page = '$page' AND id = '$id'");
   if(!mysql_num_rows($bprofcheck)=="0"){
  $bprof = mysql_fetch_array($bprofcheck);
   return $bprof;
 } else {
   return false;
} }
  function config($data) {
  $sql = "SELECT * FROM zabboweb WHERE name = '$data' LIMIT 1";
  $config = mysql_fetch_array(mysql_query($sql), MYSQL_ASSOC);
  return $config[config];
  }
   function pages($page) {
   if($page == 'acp') {
   return true;
 } else {
  $pages = mysql_query("SELECT * FROM menu WHERE url = '$page'");
  $pagez = mysql_fetch_array($pages);
   if(!mysql_num_rows($pages)=="1"){
   return false;
 } else {
   return $pagez;
} } }
   function menuthings($name, $url, $other, $data) {
   if($data == 'addpage') {
  $pages = "INSERT INTO `menu` (`id`, `name`, `url`, `img`, `who`) VALUES ('', '$name', '$url', 'images/navi_icons/tab_icon_02_hotel.gif', 'admin')";
 } elseif($data == 'deletepage') {
  $pages = "DELETE FROM menu WHERE name = '$name'";
 } elseif($data == 'renamepage') { 
  $pages = "UPDATE menu set name = '$other' WHERE name = '$name'";
 } elseif($data == 'editpageimage') { 
  $pages = "UPDATE menu set img = '$other' WHERE name = '$name'";
 } elseif($data == 'openpage') { 
  $pages = "UPDATE menu set who = 'all' WHERE name = '$name'";
 } elseif($data == 'closepage') { 
  $pages = "UPDATE menu set who = 'admin' WHERE name = '$name'";
 } else {
   return false;
 } 
mysql_query($pages);
 }
	  function addbox($page, $colum) {
	 $sql = "INSERT INTO `pages` (`id`, `colore`, `page`, `title`, `width`, `colum`, `type`, `content`) VALUES ('', 'blue', '$page', 'new', '', '$colum', 'v3box', '');";
 mysql_query($sql);
}
	  function boxcolore($id, $colore) {
	 $sql = 'UPDATE `pages` set `colore` = \''. $colore .'\' WHERE `id` = \''. $id .'\'  LIMIT 1';
 mysql_query($sql);
}
	  function updatebox($id, $content, $title) {
	 $sql = "UPDATE `pages` set `title` = '$title' WHERE id = '$id'";
 mysql_query($sql);
	 $sql = "UPDATE `pages` set `content` = '$content' WHERE id = '$id'";
 mysql_query($sql);
}
	  function nobox($id) {
	 $sql = "UPDATE `pages` set `page` = '' WHERE id = '$id'";
 mysql_query($sql);
}
}
?>