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


PHP Post::update_db方法代码示例

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


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

示例1: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$sosmed = new Post('sosmed');
if ($module == 'sosmed') {
    // UPDATE DATA
    if ($act == 'update') {
        $location = $sosmed->upload_img();
        $condition = array('id_sosmed' => $_POST['id']);
        $p_record = array('id_sosmed' => $_POST['id'], 'nama_sosmed' => $_POST['nama_sosmed'], 'link_sosmed' => $_POST['link_sosmed'], 'thumb_sosmed' => $location);
        $sosmed->update_db('sosmed', $condition, 'id_sosmed', $p_record);
        $id_sosmed = $_POST['id'];
    }
    if ($act == 'insertdb') {
        $location = $sosmed->upload_img();
        $condition = array('id_sosmed' => $_POST['id'], 'nama_sosmed' => $_POST['nama_sosmed'], 'link_sosmed' => $_POST['link_sosmed'], 'thumb_sosmed' => $location);
        $sosmed->insert_db('sosmed', $condition);
    }
    if ($act == 'delete') {
        $sosmed->delete_db('sosmed', $_GET['id']);
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:26,代码来源:aksi_sosmed.php

示例2: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$cart = new Post('cart');
echo $act;
if ($module == 'cart') {
    // UPDATE DATA
    if ($act == 'update') {
        $location = $cart->upload_img();
        $condition = array('id_cart' => $_POST['id']);
        $p_record = array('id_cart' => $_POST['id'], 'judul_cart' => $_POST['judul_cart'], 'description_cart' => $_POST['isi']);
        $cart->update_db('cart', $condition, 'id_cart', $p_record);
        $id_cart = $_POST['id'];
    }
    if ($act == 'insertdb') {
        $location = $cart->upload_img();
        $condition = array('id_cart' => $_POST['id'], 'judul_cart' => $_POST['judul_cart'], 'description_cart' => $_POST['isi']);
        $cart->insert_db('cart', $condition);
    }
    if ($act == 'delete') {
        $cart->delete_db('cart', $_GET['id']);
    }
    if ($act == 'hapusdetail') {
        $cart->delete_db('pemesanan', $_GET['id_barang']);
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:30,代码来源:aksi_cart.php

示例3: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$slider = new Post('slider');
if ($module == 'slider') {
    // UPDATE DATA
    if ($act == 'update') {
        $condition = array('id_slider' => $_POST['id']);
        $p_record = array('id_slider' => $_POST['id'], 'content_slider' => $_POST['isi']);
        $slider->update_db('slider', $condition, 'id_slider', $p_record);
    }
    if ($act == 'insertdb') {
        $location = $slider->upload_img('slider', $_FILES);
        $id_slider = $slider->get_ID('slider');
        $condition = array('id_slider' => $id_slider, 'thumb_slider' => $location);
        $slider->insert_db('slider', $condition);
    }
    if ($act == 'delete') {
        $slider->delete_db('slider', $_GET['id']);
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:25,代码来源:aksi_slider.php

示例4: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$product = new Post('product');
if ($module == 'product') {
    // UPDATE DATA
    if ($act == 'update') {
        $location = $product->upload_img();
        $condition = array('id_product' => $_POST['id']);
        $p_record = array('id_product' => $_POST['id'], 'judul_product' => $_POST['judul_product'], 'description_product' => $_POST['isi'], 'price_product' => $_POST['price_product'], 'thumb_product' => $location);
        $product->update_db('product', $condition, 'id_product', $p_record);
        $id_product = $_POST['id'];
        mysql_query("DELETE FROM mm_product_scent WHERE id_product={$id_product}");
        foreach ($_POST['scent'] as $key => $value) {
            $product->insert_db('mm_product_scent', $condition = array('id_product' => $id_product, 'id_scent' => $value));
        }
        mysql_query("DELETE FROM mm_product_category WHERE id_product={$id_product}");
        foreach ($_POST['productcategory'] as $key => $value) {
            $product->insert_db('mm_product_category', $condition = array('id_product' => $id_product, 'id_productcategory' => $value));
        }
    }
    if ($act == 'insertdb') {
        $location = $product->upload_img();
        $condition = array('id_product' => $_POST['id'], 'judul_product' => $_POST['judul_product'], 'description_product' => $_POST['isi'], 'price_product' => $_POST['price_product'], 'thumb_product' => $location);
        $product->insert_db('product', $condition);
        if (!empty($_POST['scent'])) {
            foreach ($_POST['scent'] as $key => $value) {
                $condition = array('id_product' => $_POST['id'], 'id_scent' => $value);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:31,代码来源:aksi_product.php

示例5: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$act = $_GET['act'];
$prepose = new Post('modul_child');
$prepose_condition = array('id_tipe' => 2, 'link' => "?module=" . $_GET['module']);
$prepose_result = $prepose->get_db('modul_child', $prepose_condition);
if (!empty($prepose_result)) {
    if ($act == 'update') {
        $condition = array('id_modul' => $_POST['id']);
        $p_record = array('id_modul' => $_POST['id'], 'static_content' => $_POST['isi']);
        $update_database = new Post('modul_child');
        $update_database->update_db('modul_child', $condition, 'id_modul', $p_record);
    }
}
$prepose = new Post('modul_child');
$prepose_condition = array('id_tipe' => 3, 'link' => "?module=" . $_GET['module']);
$prepose_result = $prepose->get_db('modul_child', $prepose_condition);
if (!empty($prepose_result)) {
    if ($act == 'update') {
        $condition = array('id_modul' => $_POST['id']);
        $p_record = array('id_modul' => $_POST['id'], 'static_content' => $_POST['static_content']);
        $update_database = new Post('modul_child');
        $update_database->update_db('modul_child', $condition, 'id_modul', $p_record);
    }
}
header('location:../../media.php?module=halamanadmin');
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:28,代码来源:aksi_universal_mono_editor.php

示例6: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$scent = new Post('scent');
if ($module == 'scent') {
    // UPDATE DATA
    if ($act == 'update') {
        $location = $scent->upload_img();
        $condition = array('id_scent' => $_POST['id']);
        $p_record = array('id_scent' => $_POST['id'], 'judul_scent' => $_POST['judul_scent'], 'description_scent' => $_POST['isi']);
        $scent->update_db('scent', $condition, 'id_scent', $p_record);
        $id_scent = $_POST['id'];
    }
    if ($act == 'insertdb') {
        $location = $scent->upload_img();
        $condition = array('id_scent' => $_POST['id'], 'judul_scent' => $_POST['judul_scent'], 'description_scent' => $_POST['isi']);
        $scent->insert_db('scent', $condition);
    }
    if ($act == 'delete') {
        $scent->delete_db('scent', $_GET['id']);
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:26,代码来源:aksi_scent.php

示例7: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$productcategory = new Post('productcategory');
if ($module == 'productcategory') {
    // UPDATE DATA
    if ($act == 'update') {
        $location = $productcategory->upload_img();
        $condition = array('id_productcategory' => $_POST['id']);
        $p_record = array('id_productcategory' => $_POST['id'], 'judul_productcategory' => $_POST['judul_productcategory'], 'description_productcategory' => $_POST['isi']);
        $productcategory->update_db('productcategory', $condition, 'id_productcategory', $p_record);
        $id_productcategory = $_POST['id'];
    }
    if ($act == 'insertdb') {
        $location = $productcategory->upload_img();
        $condition = array('id_productcategory' => $_POST['id'], 'judul_productcategory' => $_POST['judul_productcategory'], 'description_productcategory' => $_POST['isi']);
        $productcategory->insert_db('productcategory', $condition);
    }
    if ($act == 'delete') {
        $productcategory->delete_db('productcategory', $_GET['id']);
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:26,代码来源:aksi_productcategory.php

示例8: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
include '../../c_login.php';
$module = $_GET['module'];
$act = $_GET['act'];
$users = new Post('users');
if ($module == 'users') {
    // UPDATE DATA
    if ($act == 'update') {
        $condition = array('username' => $_POST['condition']);
        $check_password = new Login();
        $check_exist = new Post('users');
        $isExist = array('username' => $_POST['condition'], 'password' => md5($_POST['password_users_lama']));
        $hasil_check_exist = $check_exist->get_db('users', $isExist);
        if (!empty($hasil_check_exist) and !empty($_POST['password_users_baru'])) {
            $password_baru = '';
            if ($check_password->check($_POST['condition'], $_POST['password_users_baru'])) {
                $password_baru = md5($_POST['password_users_baru']);
            }
            $p_record = array('password' => $password_baru);
            $users->update_db('users', $condition, 'username', $p_record);
        } else {
            header('location:../../media.php?module=' . $module . "&salah=yes");
            exit;
        }
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:30,代码来源:aksi_users.php

示例9: Post

<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
$module = $_GET['module'];
$act = $_GET['act'];
$testimoni = new Post('testimoni');
if ($module == 'testimoni') {
    // UPDATE DATA
    if ($act == 'update') {
        $location = $testimoni->upload_img();
        $condition = array('id_testimoni' => $_POST['id']);
        $p_record = array('id_testimoni' => $_POST['id'], 'nama_testimoni' => $_POST['nama_testimoni'], 'isi_testimoni' => $_POST['isi_testimoni'], 'thumb_testimoni' => $location);
        $testimoni->update_db('testimoni', $condition, 'id_testimoni', $p_record);
        $id_testimoni = $_POST['id'];
    }
    if ($act == 'insertdb') {
        $location = $testimoni->upload_img();
        $condition = array('id_testimoni' => $_POST['id'], 'nama_testimoni' => $_POST['nama_testimoni'], 'isi_testimoni' => $_POST['isi_testimoni'], 'thumb_testimoni' => $location);
        $testimoni->insert_db('testimoni', $condition);
    }
    if ($act == 'delete') {
        $testimoni->delete_db('testimoni', $_GET['id']);
    }
}
header('location:../../media.php?module=' . $module);
开发者ID:KPjogjasite,项目名称:kingpheromone,代码行数:26,代码来源:aksi_testimoni.php


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