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


PHP require_dao函数代码示例

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


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

示例1: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_model('User');
require_dao('createQueryDAO');
use Qnet\Dao\CreateQueryDAO;
use Qnet\Model\User;
$queryName = $_POST['queryname'];
$qlength = $_POST['qlength'];
$filterslength = $_POST['filterslength'];
$uid = getUID();
$dao = new CreateQueryDAO();
$dao->initTransaction();
$dao->persistNewQuery($queryName, $uid);
for ($i = 0; $i < $qlength; $i++) {
    $dao->persistQuestion($_POST['questionname' . $i]);
    switch ($_POST['answers' . $i]) {
        case 'yesno':
            $dao->persistAnswer("Yes", 0);
            $dao->persistAnswer("No", 1);
            break;
        case 'lml':
            $dao->persistAnswer("A lot", 0);
            $dao->persistAnswer("Medium", 1);
            $dao->persistAnswer("Low", 2);
            break;
        case 'mf':
            $dao->persistAnswer("Male", 0);
            $dao->persistAnswer("Female", 1);
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:querycontroller.php

示例2: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('createStatisticsDAO');
use Qnet\Dao\CreateStatisticsDAO;
$uid = getUID();
$qid = $_POST['qid'];
$queryName = $_POST['queryname'];
$dao = new CreateStatisticsDAO();
$dao->initTransaction();
$sid = $dao->persistNewStatistic($queryName, $uid, $qid);
$j = 0;
for ($i = 0; $i < 3; $i++, $j++) {
    $varValue = $_POST['var' . ($i + 1)];
    switch ($varValue) {
        case "NONE":
            $j--;
            break;
        case "AGE":
        case "GENDER":
        case "MARITAL_STATUS":
        case "STUDIES":
        case "LOCATION":
        case "RELIGION":
            $dao->persistUserVariable($varValue, $j);
            break;
        default:
            $dao->persistQuestionVariable(intval($varValue), $j);
    }
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:staticcommitcontroller.php

示例3: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('queryDAO');
require_dao('userDAO');
require_dao('answersDAO');
require_dao('statisticsDAO');
require_model('User');
use Qnet\Dao\QueryDAO;
use Qnet\Dao\UserDAO;
use Qnet\Dao\AnswersDAO;
use Qnet\Dao\StatisticsDAO;
use Qnet\Model\User;
class StatisticsGraphicsController
{
    private $udao;
    private $adao;
    private $qdao;
    private $sdao;
    private $cardinality;
    private $varAxisMap;
    private $qid;
    private $drawable = true;
    private $series;
    function __construct()
    {
        $this->udao = new UserDAO();
        $this->qdao = new QueryDAO();
        $this->sdao = new StatisticsDAO();
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:statisticsGraphicsController.php

示例4: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('messageDAO');
require_dao('userDAO');
use Qnet\Dao\MessageDAO;
use Qnet\Dao\UserDAO;
$mdao = new MessageDAO();
$udao = new UserDAO();
$toUid = $udao->getUserIdByLastName($_POST['message_to']);
$fromUid = $_POST['message_from'];
$errors = array();
if ($toUid < 0) {
    $errors[] = "message_to:The field is empty or invalid";
}
if (empty($_POST['message_title'])) {
    $errors[] = "message_title:This field is required";
}
if (!empty($errors)) {
    $_SESSION['errors'] = $errors;
    $_SESSION['message_content'] = $_POST['message_content'];
    $_SESSION['message_to'] = $_POST['message_to'];
    $_SESSION['message_title'] = $_POST['message_title'];
    header("Location: /Qnet/target/classes/php/qnet/ui/new_message.php?errors=true");
} else {
    $mdao->sendMessage($fromUid, $toUid, $_POST['message_title'], $_POST['message_content']);
    header("Location: /Qnet/target/classes/php/qnet/ui/inbox.php");
}
/*if (mysql_num_rows(mysql_query($ck_reciever)) == 0) {
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:sendMessageController.php

示例5: dirname

namespace Qnet\Test;

/**
 * Created by IntelliJ IDEA.
 * User: Daniel
 * Date: 12/05/2010
 * Time: 21:37:10
 * To change this template use File | Settings | File Templates.
 */
namespace Qnet\Dao;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('queryDAO');
require_dao('createQueryDAO');
require_dao('answersDAO');
use Qnet\Dao\QueryDAO;
use Qnet\Dao\AnswersDAO;
use Qnet\Dao\CreateQueryDAO;
$test = new NewQueryTest();
$test->testQueryDao();
class NewQueryTest
{
    private $connector;
    private $connection;
    public function testQueryDao()
    {
        // Use Query DAO to insert a new query.
        $dao = new CreateQueryDAO();
        if ($dao == null) {
            echo "dao is null";
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:30,代码来源:NewQueryTest.php

示例6: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
check_session();
require_dao('trackingsDAO');
use Qnet\Dao\TrackingsDAO;
$followed = $_GET['uid'];
$follower = getUID();
$trackingsDAO = new TrackingsDAO();
$trackingsDAO->newTracking($follower, $followed);
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:12,代码来源:newTrackingController.php

示例7: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
check_session();
require_model('User');
require_dao('userDao');
require_dao('UserInfoDao');
use Qnet\Model\User;
use Qnet\Dao\UserDAO;
use Qnet\Dao\UserInfoDAO;
$modifyUserController = new ModifyUserController();
$modifyUserController->modifyUser();
class ModifyUserController
{
    public function modifyUser()
    {
        $username = $_POST['userName'];
        $userLastName = $_POST['userLastName'];
        $userPassword = $_POST['password'];
        $passwordAgain = $_POST['rePassword'];
        $userDao = new UserDao();
        $userInfoDao = new UserInfoDao();
        $uid = getUID();
        $user = $userDao->selectUserById($uid);
        $user->lastName = $userLastName;
        $user->password = $userPassword;
        $user->name = $username;
        User::readProperties($user, $_POST);
        $user->setInstitutionName($_POST['InstitutionName']);
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:modifyUserController.php

示例8: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao("photoDAO");
use Qnet\dao\photoDAO;
require_controller("SessionController");
use Qnet\Controller\SessionController;
$actionId = $_GET['actionId'];
if ($actionId == 1) {
    $photoController = new PhotoController();
    $photoController->uploadAndRedirect();
}
class PhotoController
{
    private $photoDao;
    private $sessionController;
    public function __construct()
    {
        $this->photoDao = new PhotoDao();
        $this->sessionController = new SessionController();
    }
    public function uploadPhoto()
    {
        $mime = $_FILES["uploadedfile"]["type"];
        $type = substr($mime, 6, strlen($mime) - 1);
        if ($type == "jpeg") {
            $size = $_FILES["uploadedfile"]["size"] / 1024;
            $userID = $this->sessionController->getUID();
            $path = "/images/profilePhotos/{$userID}.{$type}";
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:photoController.php

示例9: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\..\\util.php';
require_dao('queryDAO');
use Qnet\Dao\QueryDAO;
class AnswerQueryController
{
    private $qdao;
    private $qid;
    private $qname;
    private $questions;
    private $questionIx = -1;
    private $questionId;
    private $quid;
    private $qoptions;
    private $qoptionsIx = -1;
    private $qoptionsId;
    function __construct()
    {
        $this->uid = getUID();
        $this->qid = $_GET['qid'];
        $this->qdao = new QueryDAO();
        $query = $this->qdao->getQueryById($this->qid);
        $this->qname = $query['title'];
        $this->quid = $query['uid'];
        $this->questions = $this->qdao->getQuestionsByQueryId($this->qid);
        $this->questionIx = -1;
    }
    public function getOwnerUid()
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:answerquerycontroller.php

示例10: dirname

<?php

require_once dirname(__FILE__) . '\\..\\util.php';
require_db();
require_dao('TrackingsDAO');
require_model('User');
use Qnet\Dao\TrackingsDAO;
use Qnet\Model\User;
$trackingDAO = new TrackingsDAO();
$trackingDAO->unfollowUser(1, 2);
$results = $trackingDAO->getFollowed(2);
//a QUIEN SIGUE 2
if (array_search("1", $results) != null) {
    echo "User 2 is still followed by User 1";
}
$followersOf1 = $trackingDAO->getFollowers(1);
//Los seguidores de 1
if (array_search("2", $results) != null) {
    echo "User 2 is still followed by User 1";
}
/*
	public function getFollowers($userId){
        $connector = new DBConnector();
        $connection = $connector->createConnection();
        $result = mysql_query("SELECT t.followerId AS uid, u.name AS name FROM trackings t JOIN users u WHERE u.id=t.followerId AND t.approved=1 AND followedId='$userId'") or die ("Error");
        $ans = array();
        while($row = mysql_fetch_assoc($result)) {
            $ans[$row['uid']] = $row['name'];
        }
        mysql_free_result($result);
        mysql_close($connection);
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:TrackingTest.php

示例11: dirname

<?php

/**
 * Created by IntelliJ IDEA.
 * User: Tomas Alabes
 * Date: 15/09/2010
 * Time: 18:42:45
 * To change this template use File | Settings | File Templates.
 */
require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('userDao');
use Qnet\Dao\UserDAO;
$userDao = new UserDao();
$uid = 1;
$user = $userDao->selectUserById($uid);
$user->lastName = "Gimenez";
$user->password = "dg";
$user->name = "Daniel";
$userDao->updateUser($user, $uid);
$userUpdated = $userDao->selectUserById($uid);
if ($userUpdated->password != $user->password || $userUpdated->lastName != $user->lastName || $userUpdated->name != $user->name) {
    echo "can not update user";
}
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:23,代码来源:modifyUserTest.php

示例12: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\..\\util.php';
require_dao('UserDAO');
use Qnet\Dao\UserDAO;
$ajaxUser = $_GET["q"];
if ($ajaxUser != null) {
    $udao = new UserDao();
    $usersArray = $udao->getUsersByPartialString($ajaxUser);
    $arraySize = count($usersArray);
    $answer = "";
    foreach (array_values($usersArray) as $username) {
        $answer = $answer . $username . "\n";
    }
    echo $answer;
}
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:18,代码来源:userSuggestionController.php

示例13: dirname

<?php

/**
 * Created by IntelliJ IDEA.
 * User: Mart0
 * Date: 9/5/11
 */
require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('commentDAO');
use Qnet\Dao\CommentDAO;
$commentDao = new CommentDAO();
$newCommentId = $commentDao->saveComment(1, 1, "test");
$commentMap = $commentDao->loadAllComments(1);
echo $commentMap;
if ($commentMap[$newCommentId] == "test") {
    // ALL GOOD
} else {
    echo "Comment Test Fail";
}
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:19,代码来源:commentsTest.php

示例14: dirname

<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('messageDAO');
use Qnet\Dao\MessageDAO;
$dao = new MessageDAO();
class InboxController
{
    private $mdao;
    private $mix = -1;
    private $mid;
    private $message;
    private $messages;
    function __construct()
    {
        $this->uid = getUID();
        //getUsername();
        $this->mdao = new MessageDAO();
        $this->messages = $this->mdao->getMessages($this->uid);
        /*        $this->message = $query['title'];
                $this->quid = $query['uid'];
                $this->questions = $this->qdao->getQuestionsByQueryId($this->qid);
                $this->questionIx = -1;*/
    }
    public function hasMoreMessages()
    {
        return $this->mix + 1 < count($this->messages);
    }
    public function nextMessage()
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:inboxController.php

示例15: dirname

<?php

/**
 * Created by IntelliJ IDEA.
 * User: Tomi
 * Date: 23/06/2010
 * Time: 09:16:54
 */
namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('QueryDAO');
require_controller('listqueriescontroller');
use Qnet\Dao\QueryDAO;
use Qnet\Controller\ListQueriesController;
class SearchController
{
    private $result;
    public function searchQuery($queryTitle)
    {
        $dao = new QueryDAO();
        $queryId = $dao->getQueryIdByQueryTitle($queryTitle);
        if ($queryId != -1) {
            $this->result = $dao->getQueryById($queryId);
        } else {
            $this->result = -1;
        }
        $uid = getUID();
        $udao = new UserDAO();
        $this->result = ListQueriesController::filterQueries($this->result, $udao->selectUserById($uid));
    }
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:searchController.php


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