• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP crud类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login

 public function login($username, $password)
 {
     $crud = new crud();
     $userinfo = $crud->auth($username, $password);
     if (!$userinfo) {
         return false;
     } else {
         $this->loginIn = true;
         return $userinfo;
     }
 }
开发者ID:VladislavMaslakov,项目名称:crm-beta,代码行数:11,代码来源:user.php


示例2: obtain

 /**
  * Singleton Pattern.
  * Allows for reusing the initial instanited object.  Prevents multiple mysql connections for the same call.
  */
 public static function obtain($_server = null, $_user = null, $_password = null, $_database = null)
 {
     if (!self::$instance) {
         self::$instance = new crud($_server, $_user, $_password, $_database);
     }
     return self::$instance;
 }
开发者ID:AshrafHefny,项目名称:crud-mysql-wrapper,代码行数:11,代码来源:class.crud.php


示例3: index

 public function index()
 {
     $data['meja'] = crud::baca('tbl_meja');
     $this->load->view('1_atas', $data);
     $this->load->view('2_navbar_no', $data);
     $this->load->view('includes/meja/content', $data);
     // Beranda
     $this->load->view('4_bawah', $data);
 }
开发者ID:mikhaelfelian,项目名称:PROJECT-RESTO-TIGERA,代码行数:9,代码来源:home.php


示例4: cek_login

 public function cek_login()
 {
     $capjay = strtoupper($this->input->post('capjay'));
     $user = $this->input->post('user');
     $pass = $this->encrypt->encode_url($this->input->post('pass'));
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
     $this->form_validation->set_rules('user', 'Username', 'required');
     $this->form_validation->set_rules('pass', 'Password', 'required');
     if ($this->form_validation->run() == FALSE) {
         $msg_error = array('user' => form_error('user'), 'pass' => form_error('pass'));
         $has_error = array('user' => 'has-error', 'pass' => 'has-error');
         $this->session->set_flashdata('form_error', $msg_error);
         $this->session->set_flashdata('has_error', $has_error);
         $this->session->set_flashdata('user', $user);
         redirect('front/login.php');
     } else {
         $sess_cap = $this->session->userdata('capjay');
         //          Catch the user's answer
         if ($sess_cap != $capjay) {
             $this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, captcha tidak tervalidasi !!</div>');
             $this->session->set_flashdata('user', $user);
             redirect('front/login.php');
         } else {
             $login = akses::cek_login($user, $pass);
             if ($login == TRUE) {
                 if ($login->level != 'waiter') {
                     $this->session->set_flashdata('login', '<div class="alert alert-danger">Administrator, silahkan login ke halaman admin !!!</div>');
                     redirect('front/login.php');
                 } else {
                     $data = array('nama' => $login->nama, 'username' => $login->username, 'level' => $login->level, 'is_logged_in' => TRUE);
                     crud::update('tbl_user', 'username', $user, array('last_login' => date('Y-m-d H:i:s')));
                     $this->session->set_userdata('login', $data);
                     $this->session->set_flashdata('login', 'Login berhasil, silahkan melanjutkan transaksi');
                     redirect('front/index.php');
                 }
             } else {
                 $this->session->set_flashdata('login', '<div class="alert alert-danger">User / pass salah !!!</div>');
                 redirect('front/login.php');
             }
         }
     }
 }
开发者ID:mikhaelfelian,项目名称:PROJECT-RESTO-TIGERA,代码行数:42,代码来源:login.php


示例5: cek_login

 public function cek_login()
 {
     $capjay = strtoupper($this->input->post('capjay'));
     $user = $this->input->post('user');
     $pass = $this->encrypt->encode_url($this->input->post('pass'));
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
     $this->form_validation->set_rules('user', 'Username', 'required');
     $this->form_validation->set_rules('pass', 'Password', 'required');
     if ($this->form_validation->run() == FALSE) {
         $msg_error = array('user' => form_error('user'), 'pass' => form_error('pass'));
         $has_error = array('user' => 'has-error', 'pass' => 'has-error');
         $this->session->set_flashdata('form_error', $msg_error);
         $this->session->set_flashdata('has_error', $has_error);
         $this->session->set_flashdata('user', $user);
         redirect(site_url());
     } else {
         //            //$sess_cap = $this->session->userdata('capjay');
         //            // Catch the user's answer
         //            $captcha_answer = $this->input->post('g-recaptcha-response');
         //
         //            // Verify user's answer
         //            $sess_cap = $this->recaptcha->verifyResponse($captcha_answer);
         //            if ($sess_cap['success'] != 1) {
         //                $this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, captcha tidak tervalidasi !!</div>');
         //                $this->session->set_flashdata('user', $user);
         //                redirect(site_url());
         //            } else {
         $login = akses::cek_login($user, $pass);
         if ($login == TRUE) {
             $data = array('nama' => $login->nama, 'username' => $login->username, 'level' => $login->level, 'is_logged_in' => TRUE);
             crud::update('tbl_user', 'username', $user, array('last_login' => date('Y-m-d H:i:s')));
             $this->session->set_userdata('login', $data);
             $this->session->set_flashdata('login', 'Login berhasil, silahkan melanjutkan transaksi');
             redirect('page=home');
         } else {
             $this->session->set_flashdata('login', '<div class="alert alert-danger">User / pass salah !!!</div>');
             redirect(base_url('index.php'));
         }
     }
     //        }
 }
开发者ID:mikhaelfelian,项目名称:PROJECT-RESTO-TIGERA,代码行数:41,代码来源:login.php


示例6: array

  </div>    
  </form>
  
  </div>
		</div>
	  </div>
	</div>
	
	
<?php 
if (empty($sidErr) && empty($websiteErr) && empty($mpErr) && !empty($sid) && !empty($website) && !empty($mp) && empty($widgetErr) && !empty($widget2) && !empty($pubid) && empty($pubidErr) && $submit === "update") {
    $piwik = 2;
    $cache = true;
    $abtest = false;
    $allowedParameters = array();
    $crud = new crud();
    $crud->update($pubid, $name, $website, $piwik, $cache, $allowedParameters, $abtest, $mp, $widget2);
} else {
    if (empty($sidErr) && !empty($sid) && !empty($pubid) && empty($pubidErr) && $submit === "delete") {
        $crud = new crud();
        $crud->delete($sid, $pubid);
    }
}
?>



</body>
</html>
l
开发者ID:Vaibhav95g,项目名称:Bitsmun-user-management-portal,代码行数:30,代码来源:delete_form.php


示例7: header

<?php

// Definindo encode pra UTF-8
header('Content-type: text/html; charset="utf-8"', true);
require "../helper/class.crud.php";
require "../helper/secure_validation.php";
//change this use key of your bot
$secret_code = "testbot";
//register machine
if ($_POST['secret_code'] == $secret_code) {
    $crud = new crud();
    $name = htmlentities($_POST['name']);
    if (!$name) {
        print "need name";
        exit;
    }
    $date = date('Y-m-d H:i:s');
    $password = htmlentities($_POST['password']);
    $url = htmlentities($_POST['url']);
    $values = array(array('name' => sanitize($name), 'date' => sanitize($date), 'password' => sanitize($password), 'url' => sanitize($url)));
    $crud->dbInsert('phishing', $values);
} else {
    echo "error at secret code";
}
开发者ID:CoolerVoid,项目名称:Ooze,代码行数:24,代码来源:register_phishing.php


示例8: url

    <style type="text/css">
        @import url("/css/main-css.css")
    </style>

</head>
<body >
    <!---- Include Header    ----->
    <?php 
include '../includes/menubars.inc.php';
?>
    <!-- Main body
    ================== -->
<?php 
include_once '../mysql/hidden_files/database.php';
include_once '../classes/class.goals.crud.php';
$crud = new crud($conn);
?>
    <div class="wrapper">
       <div class="section-header fixed-top">
        <div class="container">
          <div class="row">
            <div class="col-md-2">
              <!-- Remove the .animated class if you don't want things to move -->
              <h1 class="animated slideInLeft"><span>My Goals</span></h1>
            </div>
            <div class="col-md-8">
                <h4>Hi <?php 
echo userValue(null, "FirstName");
?>
, your Goals are here. </h4>
            </div>
开发者ID:pikepa,项目名称:fitfasnfab,代码行数:31,代码来源:challenge_goals.php


示例9: session_start

<?php

session_start();
require_once 'classes/crud.php';
if (!empty($_POST)) {
    $project_name = $_POST['project_name'];
    $idworkerProject = $_SESSION['workerId'];
    $idclient = $_POST['idclient'];
    $dbObject = new crud('projects');
    $projectQuery = "INSERT INTO projects VALUES ('', '{$project_name}' , '{$idworkerProject}', '1', '{$idclient}')";
    if ($dbObject->query($projectQuery)) {
        //Вставка записи проекта
        $idproject = $dbObject->getMaxId('projects');
        $names = $_POST['name'];
        $summaries = $_POST['summary'];
        $startdates = $_POST['startdate'];
        $finishdates = $_POST['finishdate'];
        $idworkers = $_POST['worker'];
        $descriptions = $_POST['description'];
        $query = "INSERT INTO tasks VALUES ";
        for ($i = 0; $i < count($_POST['name']); $i++) {
            $set .= " ( {$names[$i]}, {$summaries[$i]}, {$startdates[$i]}, {$finishdates[$i]}, {$idproject}, {$idworkers[$i]}, {$descriptions[$i]} ),";
        }
        $set = substr($set, 0, -1);
        $query = $query . $set;
        if ($dbObject->query($query)) {
            echo "Создание проекта заверешно";
        } else {
            echo "Возникли ошибки при добавлении задач";
        }
    } else {
开发者ID:VladislavMaslakov,项目名称:crm-beta,代码行数:31,代码来源:add_projectAjax.php


示例10: session_start

<?php

session_start();
// included files
include "../../../connection/phpmysqlconnect.php";
include "../../../library/CRUD_lib.php";
include "../../../library/miss_lib.php";
// post data
$user_id = $_POST['user_id'];
$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$landline = $_POST['landline'];
$modifier = $_SESSION["user"];
// updation
$column = array('name', 'email_id', 'mobile', 'landline', 'modified_by');
$value = array("{$name}", "{$email}", "{$mobile}", "{$landline}", "{$modifier}");
$condition_column = array('user_id');
$condition_value = array("{$user_id}");
$update = new crud($conn, 'customer_details', $column, $value);
$update->update($condition_column, $condition_value);
$move->moveWithAlert('Your Profile has been updated', '../pages/editdetails.php');
开发者ID:samtherock,项目名称:Optamac_final,代码行数:22,代码来源:edit_details.php


示例11: user_hapus

 public function user_hapus()
 {
     if (akses::aksesLogin() == TRUE or akses::aksesUser() == TRUE) {
         $id = $this->encrypt->decode_url($_GET['id']);
         crud::delete('tbl_user', 'username', $id);
         $this->session->set_flashdata('pengaturan', '<div class="alert alert-success">Username : <b>' . $id . '</b>, berhasil dihapus !!</div>');
         redirect('page=pengaturan&act=user_list');
     } else {
         $this->session->set_flashdata('login', '<div class="alert alert-danger">Maaf, anda session habis. Silahkan login ulang.</div>');
         redirect(site_url());
     }
 }
开发者ID:mikhaelfelian,项目名称:PROJECT-RESTO-TIGERA,代码行数:12,代码来源:pengaturan.php


示例12: array

<?php

include "../../connection/phpmysqlconnect.php";
include "../../lib/CRUD_lib.php";
include "../../lib/miss_lib.php";
// post data
// File processing
$ext_array = array("jpeg", "jpg", "png");
$mime_array = array("image/jpeg", "image/jpg", "image/png");
$location = "../../media/featured_product/";
$image = new uploader();
if ($image->upload_validate($_FILES['files'], $ext_array, $mime_array) == true) {
    $image_name = $image->upload($_FILES['files'], $location);
    $column = array('logo');
    $value = array($image_name);
    $insert = new crud($conn, 'featured-product', $column, $value);
    $insert->insert();
    $move = new alert_redirect();
    $move->moveWithAlert('Logo has been added', '../../pages/distributor-logo.php');
}
$move->moveWithAlert('Error in uploading image', '../../pages/distributor-logo.php');
开发者ID:AbhishekShetty08,项目名称:mars-petrochem,代码行数:21,代码来源:featured_product.php


示例13: session_start

<?php

session_start();
$workerId = $_SESSION['workerId'];
if (!empty($_POST)) {
    require_once 'classes/crud.php';
    $dbObject = new crud('clients');
    $dbObject->update();
}
开发者ID:VladislavMaslakov,项目名称:crm-beta,代码行数:9,代码来源:updateClient.php


示例14: session_start

<?php

session_start();
$workerId = $_SESSION['workerId'];
if (!empty($_POST['commentText']) && !empty($_POST['idTask']) && !empty($_POST['commentText'])) {
    $commentText = $_POST['commentText'];
    $idTask = $_POST['idTask'];
    $commentText = $_POST['commentText'];
    require_once 'classes/crud.php';
    $dbObject = new crud('tasks');
    $query = "INSERT INTO comments VALUES ('', '{$workerId}', '{$idTask}', '{$commentText}')";
    if ($dbObject->query($query)) {
        echo true;
    } else {
        echo false;
    }
}
开发者ID:VladislavMaslakov,项目名称:crm-beta,代码行数:17,代码来源:addCommentToTask.php


示例15: conexao

<?php

require_once 'config/conexao.class.php';
require_once 'config/crud.class.php';
$con = new conexao();
// instancia classe de conxao
$con->connect();
// abre conexao com o banco
$crud = new crud('crudcliente');
// instancia classe com as operaçoes crud, passando o nome da tabela como parametro
$id = $_GET['id'];
//pega id para exclusao caso exista
$crud->excluir("id = {$id}");
// exclui o registro com o id que foi passado
$con->disconnect();
// fecha a conexao
header("Location: index.php");
// redireciona para a listagem
开发者ID:glayder,项目名称:CrudCliente,代码行数:18,代码来源:excluir.php


示例16: crud

    <div class="moto-widget-text-content moto-widget-text-editable"><p class="moto-text_normal"><span class="moto-color2_3"><a href="mailto:[email protected]">[email protected]</a><br/><a href="mailto:[email protected]">[email protected]</a><br/><strong>Skype: </strong>faeter2015 </span></p></div>
</div></div></div></div></div></div>


</div></div></div></div><div class="moto-cell col-sm-6" data-container="container"><div class="moto-widget moto-widget-text moto-preset-default  " data-widget="text" data-preset="default" data-spacing="laaa">
   
</div><div class="moto-widget moto-widget-text moto-preset-default            moto-spacing-top-auto moto-spacing-right-auto moto-spacing-bottom-small moto-spacing-left-auto" data-widget="text" data-preset="default" data-spacing="aasa">
    
</div><div class="moto-widget moto-widget-contact_form moto-preset-default moto-widget-empty moto-align-left moto-spacing-top-medium moto-spacing-right-auto moto-spacing-bottom-large moto-spacing-left-auto" data-preset="default" data-widget="contact_form" data-align="left" data-type="" data-spacing="mala">
    <div ng-controller="widget.ContactForm.Controller">
        
        <form class="moto-widget-contact_form-form" role="form" name="contactForm" method="POST" action="">
           						<?php 
if (isset($_POST['enviar']) && $_POST['enviar'] == 'ok') {
    include 'class/crud-pdo.php';
    $conecta = new crud();
    $conecta->conn();
    $nome = strip_tags(trim($_POST['nome']));
    $email = strip_tags(trim($_POST['email']));
    $telefone = strip_tags(trim($_POST['telefone']));
    $msg = strip_tags(trim($_POST['msg']));
    if ($nome == '') {
        echo '<div class="alert alert-danger">Você deve informar seu nome.</div>';
    } else {
        if ($email == '') {
            echo '<div class="alert alert-danger">Você deve informar um e-mail válido.</div>';
        } else {
            if ($msg == '') {
                echo '<div class="alert alert-danger">Você deve informar uma Mensagem.</div>';
            } else {
                if (!preg_match("/^[a-z0-9_\\.\\-]+@[a-z0-9_\\.\\-]*[a-z0-9_\\-]+\\.[a-z]{2,4}\$/i", $email)) {
开发者ID:janderfrancisco,项目名称:saara_cursos,代码行数:31,代码来源:contato.php


示例17: header

<?php

// Definindo encode pra UTF-8
header('Content-type: text/html; charset="utf-8"', true);
require "../helper/class.crud.php";
require "../helper/secure_validation.php";
//change this use key of your bot
$secret_code = "testbot";
//register machine
if ($_POST['secret_code'] == $secret_code) {
    $crud = new crud();
    $name = htmlentities($_POST['name']);
    if (!$name) {
        print "need name";
        exit;
    }
    $date = date('Y-m-d H:i:s');
    $system = htmlentities($_POST['system']);
    $ip = htmlentities($_POST['ip']);
    $keyboard = htmlentities($_POST['keyboard']);
    $values = array(array('name' => sanitize($name), 'date' => sanitize($date), 'ip' => sanitize($ip), 'system' => sanitize($system), 'keyboard' => sanitize($keyboard)));
    $crud->dbInsert('machine_report', $values);
} else {
    echo "error at secret code";
}
开发者ID:CoolerVoid,项目名称:Ooze,代码行数:25,代码来源:register_machine.php


示例18: crud

30. Epístolas Paulinas II
31. Epístolas Gerais II
32. Apocalipse II
33. Fundamentalismo
34. Ministérios Eclesiásticos
35. Escola Bíblica na Igreja
36. Técnicas de comunicação
								</p>
							
							</div>
							<h2>OUTRAS INFORMAÇÕES</h2>
							
							<?php 
include 'class/crud-pdo.php';
//CRUD
$conecta = new crud();
$conecta->conn();
$resultado_query = $conecta->dbSelect('cursos', 'id', 2);
foreach ($resultado_query as $res) {
}
?>
							<div  class="col-sm-6">
<p style="font-size:18px; text-align:justify;">
Investimento: de R$ <?php 
echo $res['valor_antigo'];
?>
 por R$ <?php 
echo $res['valor_prazo'];
?>
 e ainda pode ser dividido em até <?php 
echo $res['prestacao'];
开发者ID:janderfrancisco,项目名称:saara_cursos,代码行数:31,代码来源:nivel_medio.php


示例19: session_start

<?php

session_start();
$workerId = $_SESSION['workerId'];
if (!empty($_POST['idTask'])) {
    $idTask = $_POST['idTask'];
    require_once 'classes/crud.php';
    $dbObject = new crud('tasks');
    $query = "UPDATE tasks SET opened = 0 WHERE id = '{$idTask}' ";
    $dbObject->query($query);
}
开发者ID:VladislavMaslakov,项目名称:crm-beta,代码行数:11,代码来源:closeTask.php


示例20: session_start

<?php

session_start();
$workerId = $_SESSION['workerId'];
if (!empty($_POST)) {
    require_once 'classes/crud.php';
    $dbObject = new crud('tasks');
    $_POST['idfrom'] = $workerId;
    $_POST['opened'] = 1;
    $_POST['cond'] = 1;
    $dbObject->create();
}
开发者ID:VladislavMaslakov,项目名称:crm-beta,代码行数:12,代码来源:createTask.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP css类代码示例发布时间:2022-05-23
下一篇:
PHP cronBase类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap