<?
include_once('includes/top.php');
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$fin_year=$_SESSION['fin_year'];
//$br=$_SESSION['branch'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}
?>
<title>backup</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-latest.js"></script>
<link type="text/css" href="includes/style1.css" rel="stylesheet" />
<link rel="stylesheet" href="css/form.css" type="text/css" />
<script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
      $('li').has('ul').mouseover(function(){
        $(this).children('ul').show();
        }).mouseout(function(){
        $(this).children('ul').hide();
        })
          }
        });
</script>
<style>
#txt{
font-family: Arial, Helvetica;
background-color:#F2F2F2;
}
th{background-color:steelblue;color:white}
table.form{
font-weight: normal;border:1px;
}
</style>
<body>
<?php
$date=date('Y-m-d');
if($fin_year=='2015-16' || strlen($fin_year)<=0)
{
  $database="psn_ampleicherdb";
}


//$fin_year1 = substr($fin_year,2,2).substr($fin_year,-2);
    $database="psn_ampleicherdb";

$sql="update acperiod set id = 101";
$filepath="";
mysqli_query($db,$sql);
//$list = shell_exec('C:\xampp\mysql\bin\mysqldump.exe "'.$database.'" --user=root --password=@#khadi$ > C:\\backup\\"'.$database.'"_"'.$date.'".sql');
//$list = shell_exec('C:\wamp\bin\mysql\mysql5.6.17\bin\mysqldump.exe "'.$database.'" --user=root --password=@#khadi$ > C:\\backup\\"'.$database.'"_"'.$date.'".sql');
$command = "mysqldump -u psn_sales -pEich3r#psn '$database' | gzip > $filepath/'$database'_'$brcode'_'$date'.sql.gz";
echo $command;
system($command);
echo "completed successfully!"
?>