Current File : //etc/zpanel/panel/modules/migration/test.php
<?php

	require('/etc/sentora/panel/cnf/db.php');
include('/etc/sentora/panel/dryden/db/driver.class.php');
include('/etc/sentora/panel/dryden/debug/logger.class.php');
include('/etc/sentora/panel/dryden/runtime/dataobject.class.php');
include('/etc/sentora/panel/dryden/runtime/hook.class.php');
include('/etc/sentora/panel/dryden/sys/versions.class.php');
include('/etc/sentora/panel/dryden/ctrl/options.class.php');
include('/etc/sentora/panel/dryden/fs/director.class.php');
include('/etc/sentora/panel/dryden/fs/filehandler.class.php');
include('/etc/sentora/panel/inc/dbc.inc.php');
try {
    $zdbh = new db_driver("mysql:host=" . $host . ";dbname=" . $dbname . "", $user, $pass);
} catch (PDOException $e) {
    exit();
	}
	$username="hostingra";
	$sql = "SELECT * FROM vps_migration_process where create_user='$username'";
        $numrows = $zdbh->prepare($sql);
        $numrows->execute();
        if ($numrows->fetchColumn() <> 0) {
                $sql = $zdbh->prepare($sql);
            $res = array();
            $sql->execute();
            while ($rowdomains = $sql->fetch()) {
                $backup_status="";
                $restore_status="";
                if($rowdomains['flag']="download")
                {
                        if($rowdomains['backup_status']==0)
                        $backup_status="In-Progress";
                        else
                        $backup_status="Status-Completed";
                        $restore_status="N/A";
                }else
                {
                        if($rowdomains['backup_status']==0)
                        {
                        $backup_status="In-Progress";
                        $restore_status="Not yet started";
                        }
                        else
                        {
                        $backup_status="Status-Completed";
                        if($rowdomains['restore_status']=="-1")
                        $restore_status="Process Going On";
                        if($rowdomains['restore_status']=="1")
                        $restore_status="Status-Completed";
                        if($rowdomains['restore_status']=="0")
                        $restore_status="Need to start";

                        }

                }
                array_push($res, array(
                    'flag' => $rowdomains['flag'],
                    'backup_file_name' => $rowdomains['backup_file_name'],
                    'backup_status' => $backup_status,
                    'restore_status' => $restore_status,
                ));
            }
           // return $res;
	print_r($res);
        } else {
                return false;
        }

?>