Location: PHPKode > projects > Axis Groupware > musiclib/dump.php
<?php
    $phpgw_info["flags"] = array("currentapp" => "musiclib",
                               "enable_nextmatchs_class" => true,
                               "noheader" => false);
  
    include ("../header.inc.php"); #PHP Groupware header
  
    include ("inc/config.inc.php");
    include ("inc/functions.inc.php");

	print_are_you_sure_js();
    
	if ($GLOBALS['phpgw_info']['user']['apps']['admin']) {
		if ($mode == 'dump') {
			echo "Deleting artists ...<br>";
			$qry = "DELETE FROM ".$musiclib['tables']['artists'];
			$result = $GLOBALS['phpgw']->db->query($qry,__LINE__,__FILE__);
			echo "Deleting albums ...<br>";
			$qry = "DELETE FROM ".$musiclib['tables']['albums'];
			$result = $GLOBALS['phpgw']->db->query($qry,__LINE__,__FILE__);
			echo "Deleting songs ...<br>";
			$qry = "DELETE FROM ".$musiclib['tables']['songs'];
			$result = $GLOBALS['phpgw']->db->query($qry,__LINE__,__FILE__);
		} else {
			echo "<FORM name=\"dumpform\" action=".$GLOBALS['phpgw']->link("/musiclib/dump.php","mode=dump")." method=\"post\">";
	    	echo "<br>Proceeding will dump ALL music from database.<br>";
		    echo "(Playlists will not be affected)<br>";
		    echo "<BUTTON name=\"mode\" value=\"dump\" type=SUBMIT onClick=\"return Question()\">DUMP MUSIC</BUTTON>";
			echo "</form>";
		}
    } else {
    	echo "Access Denied";
    }
    
?>
Return current item: Axis Groupware