Beispiel #1
0
    if ($_REQUEST[block] == '0') {
        $msg = 'Package de-activated.';
        $class = 'warning';
    } else {
        if ($_REQUEST[block] == 'fail') {
            $msg = 'Could not perform any action on this Package. Please try again.';
            $class = 'danger';
        }
    }
}
$adminController = new AdminController();
if (!empty($_POST['btnFreeTrial'])) {
    $dataUpdate['table'] = 'packages';
    if ($_POST['txtDuration'] > 0) {
        $dataUpdate['duration'] = $_POST['txtDuration'];
        if ($adminController->insertUpdateData($dataUpdate)) {
            $msg = 'Saved successfully';
            $class = 'success';
        } else {
            $msg = 'Something went wrong. We are looking into it';
            $class = 'danger';
        }
    } else {
        $msg = 'Durations in days should not be zero';
        $class = 'danger';
    }
}
$commonController = new CommonController();
$data = $commonController->getTableData(array('table' => "packages", 'where' => array('price > 0'), 'order' => 'duration'));
?>
<script type="text/javascript">
        $data['created_date'] = date('Y-m-s H:i:s');
    }
    if ($data['title'] != $_POST['hdnTitle'] && $adminController->checkRecordUniqueNess(array('table' => $data['table'], 'column' => 'title', 'value' => $data['title'])) == 0) {
        $flag = 1;
    } else {
        if ($data['title'] == $_POST['hdnTitle']) {
            $flag = 1;
        } else {
            $flag = 0;
            $msg = 'Title should be unique. ' . $data['title'] . ' is already present';
            $class = 'danger';
            $display = 'style="display:block"';
        }
    }
    if ($flag) {
        if ($adminController->insertUpdateData($data) > 0) {
            $msg = 'Saved successfully';
            $class = 'success';
            $display = 'style="display:block"';
        } else {
            $msg = 'Something went wrong. We are looking into it';
            $class = 'danger';
            $display = 'style="display:block"';
        }
    }
}
?>
<div class="row">
	<div class="col-md-12">
		<h1 class="page-header">
			Add/Edit CMS
<?php

include 'header.php';
$msg = '';
$class = '';
$display = 'style="display:none"';
if (!empty($_POST['btnSubmit'])) {
    if (!empty($_POST['txtCurrentPassword']) && !empty($_POST['txtNewPassword']) && !empty($_POST['txtConfirmPassword']) && $_POST['txtNewPassword'] == $_POST['txtConfirmPassword']) {
        $data['table'] = '`admin-user`';
        $data['id'] = $_SESSION['adminId'];
        $data['where'] = array('password = "******"');
        $adminController = new AdminController();
        $adminResult = $adminController->getTableData($data);
        if (mysql_num_rows($adminResult) > 0) {
            $adminController->insertUpdateData(array('table' => 'admin-user', 'id' => $_SESSION['adminId'], 'password' => md5($_POST['txtNewPassword'])));
            $msg = 'Password changed successfully';
            $class = 'success';
        } else {
            $msg = 'Credential invalid';
            $class = 'danger';
        }
    } else {
        $msg = 'Wrong Input';
        $class = 'danger';
    }
    $display = 'style="display:block"';
}
?>
<div class="row">
	<div class="col-md-12">
		<h1 class="page-header">