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


PHP USER::runQuery方法代码示例

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


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

示例1: USER

<?php

session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
include_once "bill.php";
include_once "pdfDB.php";
if (!$user_home->is_logged_in()) {
    $user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if (isset($_POST['btnpdf'])) {
    $year = $_POST['year'];
    $month = $_POST['month'];
    $supcode = $_POST['supcode'];
    $unformateddate = $year . "-" . $month;
    if (!empty($_POST['supcode'])) {
        PDF::createAPDF($supcode, $unformateddate);
    } else {
        PDF::createAllPDF($unformateddate);
    }
}
?>
<!DOCTYPE html>
<html>
   <title>Suppliers</title>
   <?php 
include "include/head.php";
?>
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:report.php

示例2: USER

<?php

session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
if (!$user_home->is_logged_in()) {
    echo "";
}
if (!empty($_POST["supcode"])) {
    $uname = $_POST["supcode"];
    $s = $user_home->runQuery("SELECT * FROM suppliers WHERE supplier_code= :uname");
    $s->execute(array(":uname" => $uname));
    $userRow = $s->fetch(PDO::FETCH_ASSOC);
    if ($s->rowCount() == 1) {
        echo "<span class='status-not-available'> Supplier code Not Available.</span>";
    } else {
        echo "<span class='status-available'> Supplier code is Available.</span>";
    }
}
if (!empty($_POST["username"])) {
    $uname = $_POST["username"];
    $s = $user_home->runQuery("SELECT * FROM users WHERE username= :uname");
    $s->execute(array(":uname" => $uname));
    $userRow = $s->fetch(PDO::FETCH_ASSOC);
    if ($s->rowCount() == 1) {
        echo "<span class='status-not-available'> Username Not Available.</span>";
    }
    // else{
    // 	echo "<span class='status-available'> Username is Available.</span>";
    //  }
}
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:check.php

示例3: USER

<?php

session_start();
require_once 'class.user.php';
$user = new USER();
if ($user->is_logged_in() != "") {
    $user->redirect('home.php');
}
if (isset($_POST['btn-submit'])) {
    $email = $_POST['txtemail'];
    $stmt = $user->runQuery("SELECT userID FROM tbl_users WHERE userEmail=:email LIMIT 1");
    $stmt->execute(array(":email" => $email));
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    if ($stmt->rowCount() == 1) {
        $id = base64_encode($row['userID']);
        $code = md5(uniqid(rand()));
        $stmt = $user->runQuery("UPDATE tbl_users SET tokenCode=:token WHERE userEmail=:email");
        $stmt->execute(array(":token" => $code, "email" => $email));
        $message = "\n\t\t\t\t   Hello , {$email}\n\t\t\t\t   <br /><br />\n\t\t\t\t   We got requested to reset your password, if you did this then just click the following link to reset your password, if not just ignore this email,\n\t\t\t\t   <br /><br />\n\t\t\t\t   Click the Following Link To Reset Your Password \n\t\t\t\t   <br /><br />\n\t\t\t\t   <a href='http://localhost/event_management/resetpass.php?id={$id}&code={$code}'>click here to reset your password</a>\n\n\t\t\t\t   <br /><br />\n\t\t\t\t   thank you :)\n\t\t\t\t   ";
        $subject = "Password Reset";
        $user->send_mail($email, $message, $subject);
        $msg = "<div class='alert alert-success'>\n\t\t\t\t\t<button class='close' data-dismiss='alert'>&times;</button>\n\t\t\t\t\tWe've sent an email to {$email}.\n                    Please click on the password reset link in the email to generate new password. \n\t\t\t  \t</div>";
    } else {
        $msg = "<div class='alert alert-danger'>\n\t\t\t\t\t<button class='close' data-dismiss='alert'>&times;</button>\n\t\t\t\t\t<strong>Sorry!</strong>  this email not found. \n\t\t\t    </div>";
    }
}
?>

<!DOCTYPE html>
<html>
  <head>
开发者ID:karthikkrishnamurthi,项目名称:event_management,代码行数:31,代码来源:fpass.php

示例4: USER

<?php

session_start();
require_once 'classes/class.user.php';
$user = new USER();
$code = '0001';
$sql = "SELECT * FROM `suppliers` WHERE supplier_code = {$code}";
$getdata = $user->runQuery($sql);
$getdata->execute();
if (!empty($code)) {
    if ($getdata->rowCount() > 0) {
        while ($row = $getdata->FETCH(PDO::FETCH_ASSOC)) {
            $name = $row['f_name'] . " " . $row['l_name'];
            $addr = $row['address_1'];
            $mobile = $row['mobile_no'];
            $email = $row['e_mail'];
        }
    }
}
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Tsms | Details view</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:webpage.php

示例5: USER

<?php

require_once 'classes/class.user.php';
$user = new USER();
if (empty($_GET['id']) && empty($_GET['code'])) {
    $user->redirect('index.php');
}
if (isset($_GET['id']) && isset($_GET['code'])) {
    $id = base64_decode($_GET['id']);
    $code = $_GET['code'];
    $stmt = $user->runQuery("SELECT * FROM users WHERE id=:uid AND token_Code=:token");
    $stmt->execute(array(":uid" => $id, ":token" => $code));
    $rows = $stmt->fetch(PDO::FETCH_ASSOC);
    if ($stmt->rowCount() == 1) {
        if (isset($_POST['btn-reset-pass'])) {
            $pass = $_POST['pass'];
            $cpass = $_POST['confirm-pass'];
            if ($cpass !== $pass) {
                $msg = '<div class="callout callout-warning">
                    <h4>Sorry!</h4>
                    <p>Password Does not match.</p>
                  </div>';
            } else {
                $password = md5($cpass);
                $stmt = $user->runQuery("UPDATE users SET password=:upass WHERE id=:uid");
                $stmt->execute(array(":upass" => $password, ":uid" => $rows['id']));
                $msg = "<div class='alert alert-success'>\n            <button class='close' data-dismiss='alert'>&times;</button>\n            Password Changed.\n            </div>";
                header("refresh:5;index.php");
            }
        }
    } else {
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:resetpass.php

示例6: USER

<?php

require_once "../librairies/user.php";
$auth_user = new USER();
$stmt = $auth_user->runQuery("SELECT * FROM user ORDER BY login");
$stmt->execute();
$utilisateurs = $stmt->fetchAll();
if (isset($_POST['btn-edit'])) {
    $uname = strip_tags($_POST['ulogin']);
    $upass = strip_tags($_POST['upassword']);
    if ($upass == "") {
        $error[] = "Il manque le mot de passe !";
    } else {
        if (strlen($upass) < 6) {
            $error[] = "Le mot de passe doit au moins contenir 6 caractères";
        } else {
            try {
                if ($auth_user->updateUser($uname, $upass)) {
                    $auth_user->redirect('editUser.php?joined');
                }
            } catch (PDOException $e) {
                echo $e->getMessage();
            }
        }
    }
}
?>
<!DOCTYPE>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
开发者ID:Mousticke,项目名称:pinf,代码行数:31,代码来源:editUser.php

示例7: USER

<?php

session_start();
require_once '../php-assets/class.user.php';
$user = new USER();
if ($user->is_loggedin() != "") {
    $user->redirect('advert-overview.php');
}
if (isset($_POST['register-button'])) {
    $user_first_name = strip_tags(htmlentities($_POST['user-first-name'], ENT_COMPAT, 'UTF-8'));
    $user_last_name = strip_tags(htmlentities($_POST['user-last-name'], ENT_COMPAT, 'UTF-8'));
    $user_email = strip_tags($_POST['user-email']);
    $user_password = strip_tags($_POST['user-password']);
    try {
        $stmt = $user->runQuery("SELECT user_firstname, user_email FROM tbl_user WHERE user_firstname=:user_first_name OR user_email=:user_email");
        $stmt->execute(array(':user_first_name' => $user_first_name, ':user_email' => $user_email));
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        if ($row['user_email'] == $user_email) {
            $error[] = "Er is al een account aangemaakt met dit e-mail adres.";
        } else {
            if ($user->register($user_first_name, $user_last_name, $user_email, $user_password)) {
                $user->doLogin($user_email, $user_password);
                $user->redirect('advert-overview.php');
            }
        }
    } catch (PDOException $e) {
        echo $e->getMessage();
    }
}
?>
<!doctype html>
开发者ID:kangube,项目名称:kangu-product,代码行数:31,代码来源:register.php

示例8: USER

<?php

session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
require_once 'DB/dbupdates.php';
$dbupdates = new DBupdates();
if (!$user_home->is_logged_in()) {
    $user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$code = "";
$supname = "";
$supnic = "";
$apptearate = "";
$suppkgs = "";
$totincome = "";
$paid = "";
$remainbalance = "";
$formateddate = date('Y-m-d');
if (isset($_POST['search'])) {
    $code = $_POST['code'];
    if ($dbupdates->checkSupplierExist($code) == true) {
        $supname = $dbupdates->getSupplierName($code);
        $supnic = $dbupdates->getMyNIC($code);
        $apptearate = $dbupdates->thisMonthTeaRate();
        $kgs1 = $dbupdates->getTodayMySupply($code);
        $kgs2 = $dbupdates->myTotalSupplyOfaMonth($code, $formateddate);
        $pay1 = $dbupdates->thisMonthPayForMe($code);
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:update.php

示例9: USER

<!-- Main Header -->
<header class="main-header">
<?php 
require_once 'classes/class.user.php';
$user_home = new USER();
$list = "SELECT message_id FROM message_temp WHERE date=CURDATE() AND approve=0";
$getdata = $user_home->runQuery($list);
$getdata->execute();
$res1 = 0;
if ($getdata->rowCount() > 0) {
    while ($data = $getdata->FETCH(PDO::FETCH_ASSOC)) {
        $res1 = $res1 + 1;
    }
}
$list = "SELECT supplier_code FROM today_supply WHERE date=CURDATE()";
$getdata = $user_home->runQuery($list);
$getdata->execute();
$res2 = 0;
if ($getdata->rowCount() > 0) {
    while ($data = $getdata->FETCH(PDO::FETCH_ASSOC)) {
        $res2 = $res2 + 1;
    }
}
?>
  <!-- Logo -->
  <a href="home.php" class="logo">
    <!-- mini logo for sidebar mini 50x50 pixels -->
    <span class="logo-mini"><b>T</b>SMS</span>
    <!-- logo for regular state and mobile devices -->
    <span class="logo-lg"><img src="dist/logo.png"></span>
  </a>
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:header.php

示例10: USER

<?php

session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
require_once 'DB/dbupdates.php';
$dbupdates = new DBupdates();
if (!$user_home->is_logged_in()) {
    $user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html>
   <title>Daily Update</title>
   <?php 
include "include/head.php";
?>
   <script type="text/javascript" src="plugins/alert/dist/jquery-1.11.3.min.js"></script>
   <script type="text/javascript" src="plugins/alert/dist/sweetalert.min.js"></script>
   <script type="text/javascript" src="plugins/alert/dist/sweetalert-dev.js"></script>
   <script type="text/javascript">
      // $(function(){
      
      // swal("Sweet Alert hureeeeee!");
      
      // });
   </script>
   <?php 
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:service.php

示例11: catch

 if (isset($_POST['uadmin'])) {
     $ustatut = 1;
 } else {
     $ustatut = 0;
 }
 if ($uname == "") {
     $error[] = "Il manque le nom d'utilisateur !";
 } else {
     if ($upass == "") {
         $error[] = "Il manque le mot de passe !";
     } else {
         if (strlen($upass) < 6) {
             $error[] = "Le mot de passe doit au moins contenir 6 caractères";
         } else {
             try {
                 $stmt = $user->runQuery("SELECT login FROM user WHERE login=:uname");
                 $stmt->execute(array(':uname' => $uname));
                 $row = $stmt->fetch(PDO::FETCH_ASSOC);
                 if ($row['login'] == $uname) {
                     $error[] = "Le nom d'utilisateur existe déjà !";
                 } else {
                     if ($user->enregistrerUser($uname, $upass, $ustatut)) {
                         $user->redirect('creerUser.php?joined');
                     }
                 }
             } catch (PDOException $e) {
                 echo $e->getMessage();
             }
         }
     }
 }
开发者ID:Mousticke,项目名称:pinf,代码行数:31,代码来源:creerUser.php

示例12: USER

<?php

session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
if (!$user_home->is_logged_in()) {
    $user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html>
<title>View Suppliers</title>
  <?php 
include "include/head.php";
?>
  
    <div class="wrapper">

      <?php 
include "include/header.php";
?>
      <!-- Left side column. contains the logo and sidebar -->
      <aside class="main-sidebar">

        <!-- sidebar: style can be found in sidebar.less -->
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:30,代码来源:view.php

示例13: USER

<?php

require_once "session.php";
require_once "class.user.php";
$auth_user = new USER();
$user_id = $_SESSION['user_session'];
$stmt = $auth_user->runQuery("SELECT * FROM admin WHERE id=:user_id");
$stmt->execute(array(":user_id" => $user_id));
$userRow = $stmt->fetch(PDO::FETCH_ASSOC);
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600"
        rel="stylesheet">
<link href="css/font-awesome.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/pages/dashboard.css" rel="stylesheet">
<title>welcome - <?php 
print $userRow['username'];
?>
</title>
</head>
<body>
<div class="navbar navbar-fixed-top">
开发者ID:Esdras1995,项目名称:Guardtour,代码行数:31,代码来源:home.php

示例14: catch

 if (strlen($upass) < 4) {
     $error[] = "Password must be atleast 4 characters";
     echo "Password must be atleast 4 characters";
     return false;
 } else {
     if ($upass != $rpass) {
         $error[] = "Passwords must be the same";
         echo "Passwords must be the same";
         return false;
     } else {
         if ($sec != $val3) {
             echo "ERROR CODE VERIFICATION...";
             return false;
         } else {
             try {
                 $stmt = $login->runQuery("SELECT user_name FROM users WHERE user_name=:uname");
                 $stmt->execute(array(':uname' => $uname));
                 $row = $stmt->fetch(PDO::FETCH_ASSOC);
                 if ($row['user_name'] == $uname) {
                     $error[] = "sorry username or mail already taken !";
                     echo "sorry username or mail already taken !";
                     return false;
                 } else {
                     if ($login->register($uname, $upass, $code)) {
                         //$login->redirect('../login/index.php?joined');
                         echo "DONE";
                         return true;
                     }
                 }
             } catch (PDOException $e) {
                 echo $e->getMessage();
开发者ID:walterleonardo,项目名称:Php,代码行数:31,代码来源:class.user.php

示例15: USER

<?php

require_once "../config/class.user.php";
$auth_user = new USER();
//example of request
// http://127.0.0.1:8000/home/dashboardshow.php?btn-update=enable&type=load&userid=2239&clientid=1
if (isset($_GET['btn-update'])) {
    if (isset($_GET['type']) and $_GET['type'] == 'load') {
        $uid = strip_tags(filter_input(INPUT_GET, 'userid'));
        $cid = strip_tags(filter_input(INPUT_GET, 'clientid'));
        $sql = "SELECT * FROM clients WHERE id={$cid} and user_id={$uid}";
        $stmt = $auth_user->runQuery($sql);
        $stmt->execute();
        $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
    }
    $file = 'saved_images/photo_UID:' . $uid . '_CID:' . $cid . '.jpg';
    ?>
    <!DOCTYPE html>
    <html lang="es">
        <head>
            <meta charset="UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="apple-mobile-web-app-capable" content="yes">
            <meta name="apple-mobile-web-app-status-bar-style" content="black">
            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
            <!--  <meta name="viewport" content="width=device-width, initial-scale=1"> -->
            <meta name="description" content="Control Parental, Internet por fin segura">
            <meta name="keywords" content="Parental control,Control parental,parental,control, seguridad, internet, niños, seguros, navegación, filtros, antivirus, internet segura, firewall, cortafuego, analisis, paginas, seguras">
            <meta name="author" content="admin@WifiCounter.es">
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
            <!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
开发者ID:walterleonardo,项目名称:Php,代码行数:31,代码来源:dashboardshow.php


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