当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminController::insertUpdateData方法代码示例

本文整理汇总了PHP中AdminController::insertUpdateData方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::insertUpdateData方法的具体用法?PHP AdminController::insertUpdateData怎么用?PHP AdminController::insertUpdateData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminController的用法示例。


在下文中一共展示了AdminController::insertUpdateData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AdminController

    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">
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:packages.php

示例2: date

        $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
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:add_edit_cms.php

示例3: array

<?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 = "' . md5($_POST['txtCurrentPassword']) . '"');
        $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">
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:change_password.php


注:本文中的AdminController::insertUpdateData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。