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


PHP History类代码示例

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


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

示例1: insert

 /**
  * bool insert(Patient $patient, History $historyP, History $historyF, int $idUser, string $login)
  *
  * Inserts a new deleted patient into the database.
  *
  * @param Patient $patient patient to insert
  * @param History $historyP patient's personal antecedents to insert
  * @param History $historyF patient's family antecedents to insert
  * @param int $idUser key of user that makes deletion
  * @param string $login login session of user that makes deletion
  * @return boolean returns false, if error occurs
  * @access public
  */
 function insert($patient, $historyP, $historyF, $idUser, $login)
 {
     $sql = "INSERT INTO " . $this->_table;
     $sql .= " (id_patient, nif, first_name, surname1, surname2, address, phone_contact, ";
     $sql .= "sex, race, birth_date, birth_place, decease_date, nts, nss, ";
     $sql .= "family_situation, labour_situation, education, insurance_company, ";
     $sql .= "id_member, collegiate_number, birth_growth, growth_sexuality, feed, habits, ";
     $sql .= "peristaltic_conditions, psychological, children_complaint, venereal_disease, ";
     $sql .= "accident_surgical_operation, medicinal_intolerance, mental_illness, ";
     $sql .= "parents_status_health, brothers_status_health, spouse_childs_status_health, ";
     $sql .= "family_illness, create_date, id_user, login) VALUES (";
     $sql .= "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ";
     $sql .= "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ";
     $sql .= "?, ?, ?, ?, NOW(), ?, ?);";
     $params = array($patient->getIdPatient(), urlencode($patient->getNIF()), urlencode($patient->getFirstName()), urlencode($patient->getSurname1()), urlencode($patient->getSurname2()), urlencode($patient->getAddress()), urlencode($patient->getPhone()), $patient->getSex(), urlencode($patient->getRace()), $patient->getBirthDate(), urlencode($patient->getBirthPlace()), $patient->getDeceaseDate(), urlencode($patient->getNTS()), urlencode($patient->getNSS()), urlencode($patient->getFamilySituation()), urlencode($patient->getLabourSituation()), urlencode($patient->getEducation()), urlencode($patient->getInsuranceCompany()), $patient->getIdMember(), urlencode($patient->getCollegiateNumber()), urlencode($historyP->getBirthGrowth()), urlencode($historyP->getGrowthSexuality()), urlencode($historyP->getFeed()), urlencode($historyP->getHabits()), urlencode($historyP->getPeristalticConditions()), urlencode($historyP->getPsychological()), urlencode($historyP->getChildrenComplaint()), urlencode($historyP->getVenerealDisease()), urlencode($historyP->getAccidentSurgicalOperation()), urlencode($historyP->getMedicinalIntolerance()), urlencode($historyP->getMentalIllness()), urlencode($historyF->getParentsStatusHealth()), urlencode($historyF->getBrothersStatusHealth()), urlencode($historyF->getSpouseChildsStatusHealth()), urlencode($historyF->getFamilyIllness()), intval($idUser), urlencode($login));
     return $this->exec($sql, $params);
 }
开发者ID:edubort,项目名称:openclinic-1,代码行数:30,代码来源:DelPatient.php

示例2: action_history

 public function action_history()
 {
     $data = array('content' => $this->executeCommand(), 'currentdb' => Request::factory()->getDb(), 'cmd' => Request::factory()->getCmd(), 'dbkeys' => Helper_Info::getCountKeysInDb(), 'history' => History::getLast($_SESSION['login']));
     if (Request::factory()->getAjax()) {
         header('Content-Type: application/json');
         echo json_encode($data);
     } else {
         echo View::factory('layout', $data);
     }
 }
开发者ID:xingcuntian,项目名称:readmin,代码行数:10,代码来源:Index.php

示例3: actionUnban

 public function actionUnban($id)
 {
     $ban_model = $this->loadModel($id);
     if (!Webadmins::checkAccess('bans_unban', $ban_model->admin_nick)) {
         throw new CHttpException(403, "У Вас недостаточно прав");
     }
     $history_model = new History();
     $history_model->unsetAttributes();
     $history_model->player_ip = $ban_model->player_ip;
     $history_model->player_id = $ban_model->player_id;
     $history_model->player_nick = $ban_model->player_nick;
     $history_model->admin_ip = $ban_model->admin_ip;
     $history_model->admin_id = $ban_model->admin_id;
     $history_model->admin_nick = $ban_model->admin_nick;
     $history_model->ban_type = $ban_model->ban_type;
     $history_model->ban_reason = $ban_model->ban_reason;
     $history_model->ban_created = $ban_model->ban_created;
     $history_model->ban_length = $ban_model->ban_length;
     $history_model->server_ip = $ban_model->server_ip;
     $history_model->server_name = $ban_model->server_name;
     $history_model->unban_created = time();
     $history_model->unban_reason = 'Разбанен с сайта';
     $history_model->unban_admin_nick = Yii::app()->user->name;
     if ($history_model->save()) {
         if ($ban_model->delete()) {
             Yii::app()->end('Игрок разбанен');
         }
     }
     Yii::app()->end(CHtml::errorSummary($ban_model));
 }
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:30,代码来源:BansController.php

示例4: initializeWithRawData

 /**
  * Initialize the object with raw data
  *
  * @param $data
  * @return History
  */
 public static function initializeWithRawData($data)
 {
     $item = new History();
     if (isset($data['created_at'])) {
         $item->setCreatedAt(new \DateTime('@' . strtotime($data['created_at'])));
     }
     if (isset($data['message'])) {
         $item->setMessage($data['message']);
     }
     return $item;
 }
开发者ID:sumocoders,项目名称:factr,代码行数:17,代码来源:History.php

示例5: createHistory

 protected function createHistory()
 {
     $user = $this->getMockBuilder('Application\\UserBundle\\Document\\User')->setMethods(array('getUsernameCanonical', 'getCreatedAt'))->getMock();
     $user->expects($this->once())->method('getUsernameCanonical')->will($this->returnValue('joe'));
     $user->expects($this->once())->method('getCreatedAt')->will($this->returnValue(new \DateTime()));
     $history = new History($user);
     foreach (array(1 => 1200, 2 => 1250, 3 => 1300, 4 => 1250, 5 => 1300, 6 => 1100) as $ts => $elo) {
         $history->addUnknownGame($ts, $elo);
     }
     return $history;
 }
开发者ID:hotfics,项目名称:lichess-old,代码行数:11,代码来源:HistoryTest.php

示例6: isSatisfied

 /**
  * method that checks if the contidion is satisfied
  * for the passed id_user in the passed id_course_instance
  *
  * @param int $id_course_instance
  * @param int $id_user
  * @return boolean true if condition is satisfied
  * @access public
  */
 private function isSatisfied($id_course_instance = null, $id_student = null)
 {
     require_once ROOT_DIR . '/include/history_class.inc.php';
     $history = new History($id_course_instance, $id_student);
     $history->get_visit_time();
     if ($history->total_time > 0) {
         $timeSpentInCourse = intval($history->total_time / 60);
     } else {
         $timeSpentInCourse = 0;
     }
     return $timeSpentInCourse >= $this->_param;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:21,代码来源:completeConditionTime.class.inc.php

示例7: createFor

 static function createFor(HistoricalObjectI $object)
 {
     $data = $object->getDataForHistory();
     if (!is_array($data)) {
         $data = array($data);
     }
     foreach ($data as $historyDataEntry) {
         $history = new History();
         $history->setUserId($historyDataEntry->getUserId());
         $history->setEntityType(get_class($object));
         $history->setData(serialize($historyDataEntry->getData()));
         $history->save();
     }
 }
开发者ID:rayku,项目名称:rayku,代码行数:14,代码来源:HistoryPeer.php

示例8: update

 public function update(array $data, $where)
 {
     //save a snapshot now
     require_once 'History.php';
     $historyTable = new History('trainer');
     //cheezy way to get the id
     $parts = explode('=', $where[0]);
     $pid = trim($parts[1]);
     //link to the last history row
     $personHistoryTable = new History('person');
     $hrow = $personHistoryTable->fetchAll("person_id = {$pid}", "vid DESC", 1);
     $historyTable->insert($this, $hrow->current()->vid);
     $rslt = parent::update($data, $where);
     return $rslt;
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:15,代码来源:Trainer.php

示例9: getHistoryNews

 public function getHistoryNews()
 {
     $newspaper_id = Input::get('newspaper', '') != '' ? Input::get('newspaper') : false;
     $tag_id = Input::get('tag', '') != '' ? Input::get('tag') : false;
     $query = History::with('newspaper')->with('tag')->select(DB::raw('MAX(total_day) as total_day'), DB::raw('DATE(date) as sdate'), 'history.id as id', 'history.url as url', 'history.id_newspaper as id_newspaper', 'history.id_tag as id_tag', 'history.final_url as final_url', 'history.title as title', 'history.date as date', 'history.facebook as facebook', 'history.twitter as twitter', 'history.total as total', 'history.googleplus as googleplus', 'history.linkedin as linkedin', 'history.image as image')->groupBy('sdate')->orderBy('date', 'DESC');
     return Response::json($query->get());
 }
开发者ID:vmariano,项目名称:shared-links-ranking,代码行数:7,代码来源:ApiController.php

示例10: clear

 public function clear()
 {
     $this->autoRender = false;
     if ($this->request->is('post')) {
         return json_encode(History::clear($this->Session));
     }
 }
开发者ID:rjawor,项目名称:tagging,代码行数:7,代码来源:HistoryController.php

示例11: writeHistory

 private function writeHistory($response, $transactionRequest)
 {
     $id_pedido = (int) $this->module->currentOrder;
     $id_transacao = $response->transactionId;
     $id_status = (int) Configuration::get('PS_OS_BCASH_IN_PROGRESS');
     $status = urldecode($response->descriptionStatus);
     $paymentMethodHelper = new PaymentMethodHelper();
     $pagamento_meio = $paymentMethodHelper->getById(Tools::getValue('payment-method'));
     if (PaymentMethodHelper::isCard($pagamento_meio)) {
         $parcelas = Tools::getValue('card-installment');
     } else {
         $parcelas = 1;
     }
     $history = new History($id_pedido, $id_transacao, $id_status, $status, $pagamento_meio->title, $parcelas);
     $history->write();
 }
开发者ID:payu-br,项目名称:bcash-prestashop-transparente,代码行数:16,代码来源:validation.php

示例12: Roll

 public static function Roll($chance)
 {
     $coinCode = Input::get('coinCode');
     $betSize = Input::get('betsize');
     $profit = Input::get('profit');
     $payout = Input::get('payout');
     $roll = rand(1, 100);
     if ($roll < $chance) {
         $result = 'Win';
     } else {
         $result = 'Lose';
     }
     $wallet_balance = strtolower($coinCode) . "_wallet_balance";
     if (Auth::user()->{$wallet_balance} >= $betSize) {
         if ($result == 'Win') {
             $balance = Coin::Give($coinCode, $profit);
         } else {
             $balance = Coin::Take($coinCode, $betSize);
         }
         History::Add($betSize, $payout, $profit, $coinCode);
     } else {
         $result = "No Funds";
         $balance = Auth::user()->{$wallet_balance};
     }
     return json_encode(['result' => $result, 'profit' => $balance]);
 }
开发者ID:kartx22,项目名称:Otoru-Dice,代码行数:26,代码来源:Coin.php

示例13: show_GET

function show_GET($w)
{
    list($lotid, $householdid) = $w->pathMatch("lotid", "householdid");
    if (empty($lotid)) {
        $w->error("Need a Lot ID");
    }
    if (empty($householdid)) {
        $w->error("Need a household ID");
    }
    $lot = $w->Bend->getLotForId($lotid);
    if (empty($lot)) {
        $w->error("Lot {$lotid} does not exist");
    }
    $household = $w->Bend->getHouseholdForId($householdid);
    if (empty($household)) {
        $w->error("Household {$householdid} does not exist");
    }
    History::add("Bend Household: " . $household->streetnumber);
    $lotTable = array();
    $lotTable["Household"] = array(array(array("Lot Number", "static", "", $lot->lot_number), array("Occupancy", "static", "", $lot->occupancy)), array(array("Street Number", "static", "", $household->streetnumber), array("Is CHL?", "static", "", $household->is_chl ? "yes" : "no"), array("Is Occupied?", "static", "", $household->is_occupied ? "yes" : "no"), array("Number of Occupants", "static", "", $household->num_occupants)));
    $w->ctx("lot", $lot);
    $w->ctx("table", Html::multiColTable($lotTable));
    $w->ctx("household", $household);
    $w->ctx("currentOccupants", $household->getCurrentOccupants());
    $w->ctx("pastOccupants", $household->getPastOccupants());
}
开发者ID:careck,项目名称:bendms,代码行数:26,代码来源:show.php

示例14: index

 function index()
 {
     $h = new History();
     $events = $h->include_related('user')->order_by('id DESC')->get_iterated();
     foreach ($events as $e) {
         $message = unserialize($e->message);
         if (is_string($message)) {
             $message = $this->messages[$message];
         } else {
             $key = array_shift($message);
             $message = vsprintf($this->messages[$key], $message);
         }
         echo $message . ' by ' . $e->user_username . ' ' . time_ago($e->created_on) . '<br>';
     }
     exit;
 }
开发者ID:Atomox,项目名称:benhelmerphotography,代码行数:16,代码来源:histories.php

示例15: viewtaskgrouptypes_ALL

function viewtaskgrouptypes_ALL(Web $w)
{
    $w->Task->navigation($w, "Manage Task Groups");
    History::add("Manage Task Groups");
    $task_groups = $w->Task->getTaskGroups();
    if ($task_groups) {
        usort($task_groups, array("TaskService", "sortbyGroup"));
    }
    // prepare column headings for display
    $line = array(array("Title", "Type", "Description", "Default Assignee"));
    // if task group exists, display title, group type, description, default assignee and button for specific task group info
    if ($task_groups) {
        foreach ($task_groups as $group) {
            $line[] = array(Html::a(WEBROOT . "/task-group/viewmembergroup/" . $group->id, $group->title), $group->getTypeTitle(), $group->description, $group->getDefaultAssigneeName());
        }
    } else {
        // if no groups for this group type, say as much
        $line[] = array("There are no Task Groups Configured. Please create a New Task Group.", "", "", "", "");
    }
    // display list of task groups in the target task group type
    $w->ctx("dashboard", Html::table($line, null, "tablesorter", true));
    // tab: new task group
    // get generic task group permissions
    $arrassign = $w->Task->getTaskGroupPermissions();
    // unset 'ALL' given all can never assign a task
    unset($arrassign[0]);
    // set Is Task Active dropdown
    $is_active = array(array("Yes", "1"), array("No", "0"));
    $grouptypes = $w->Task->getAllTaskGroupTypes();
    // build form to create a new task group within the target group type
    $f = Html::form(array(array("Task Group Attributes", "section"), array("Task Group Type", "select", "task_group_type", null, $grouptypes), array("Title", "text", "title"), array("Who Can Assign", "select", "can_assign", null, $arrassign), array("Who Can View", "select", "can_view", null, $w->Task->getTaskGroupPermissions()), array("Who Can Create", "select", "can_create", null, $w->Task->getTaskGroupPermissions()), array("Active", "select", "is_active", null, $is_active), array("", "hidden", "is_deleted", "0"), array("Description", "textarea", "description", null, "26", "6"), array("Default Assignee", "select", "default_assignee_id", null, $w->Auth->getUsers())), $w->localUrl("/task-group/createtaskgroup"), "POST", "Save");
    // display form
    $w->ctx("creategroup", $f);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:34,代码来源:viewtaskgrouptypes.php


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