daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     if(!include(dirname($_SERVER['DOCUMENT_ROOT']) . "/conf/config.inc"))
  3.     {
  4.         echo "<b>Error:</b> can't see configuration files. Stopped.<br />";
  5.         echo "Please, contact your system administrator.";
  6.         exit();
  7.     }
  8.     $sql = "SELECT COUNT(*) AS `all`, SUM(ktnSex = 1) AS male, SUM(ktnSex = 2) AS female FROM kittens";
  9.     $smarty->assign('kittens', $DB->selectRow($sql));
  10.    
  11.     $sql = "SELECT COUNT(*) AS `all`, SUM(sex = 1) AS male, SUM(sex = 2) AS female FROM parents WHERE archive != 1";
  12.     $smarty->assign("parents", $DB->selectRow($sql));
  13.     $smarty->assign("sirdam", $DB->selectCell("SELECT COUNT(*) FROM parents"));
  14.    
  15.     $parentPhotos = $DB->selectCell("SELECT COUNT(*) FROM parentsPhotos");
  16.     $photos = $DB->selectCell("SELECT COUNT(*) FROM photos");
  17.     $smarty->assign('parentPhotos', $parentPhotos);
  18.     $smarty->assign('photos', $photos);
  19.     $smarty->assign('photosSum', $parentPhotos + $photos);
  20.    
  21.     $litters = $DB->selectRow("SELECT COUNT(*) AS allLitters, (SELECT COUNT(*) FROM litters WHERE hidden = 1) AS hiddenLitters FROM litters");
  22.     $smarty->assign('litters', $litters);
  23.    
  24.     $smarty->assign('carousel', $DB->selectCell("SELECT COUNT(*) FROM photos WHERE photos.photoC = 1"));
  25.    
  26.     $sql = "SELECT COUNT(*) AS newsAll FROM news";
  27.     $smarty->assign('news', $DB->selectCell($sql));
  28.    
  29.     $smarty->assign('pages', $DB->selectCell("SELECT COUNT(*) FROM staticPages"));
  30.    
  31.    
  32.     $smarty->display('header.tpl');
  33.     $smarty->display('index.tpl');
  34.     $smarty->display('footer.tpl');
  35.  
  36.  
  37.  
  38.  
  39. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top