本文整理汇总了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">
示例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
示例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">