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


PHP AMA_DataHandler::date_to_ts方法代码示例

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


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

示例1: add_request

function add_request($user_id, $type = 0)
{
    // insert user_id, date, type  into table "requests"
    $date = AMA_DataHandler::date_to_ts("now");
    $token = sha1($date);
    // o altro algoritmo
    $status = ADA_REQUEST_STATUS_SET;
    // insert  $date, $userid, $token, $type, $status
    // if ok:
    return $token;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:11,代码来源:forget_functions.inc.php

示例2: course_instance_subscribeable_get_list

 public function course_instance_subscribeable_get_list($field_list_ar, $courseId)
 {
     $today_date = today_dateFN();
     $timestamp = AMA_DataHandler::date_to_ts($today_date);
     //        $timestamp = time();
     //        return $this->course_instance_find_list($field_list_ar, "id_corso=$courseId AND self_registration=1 AND data_inizio=0 AND data_inizio_previsto >= $timestamp and durata > 0  ORDER BY data_inizio_previsto ASC");
     return $this->course_instance_find_list($field_list_ar, "id_corso={$courseId} AND self_registration=1 AND open_subscription=1 ORDER BY data_inizio_previsto ASC");
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:8,代码来源:ama.inc.php

示例3: urlencode

 $testerId = $tester_infoHa['id_tester'];
 // it is an integer
 // find tester DH from tester pointer
 $tester_dh = AMA_DataHandler::instance(MultiPort::getDSN($tester));
 $serviceObj = Service::findServiceFromImplementor($id_course);
 $serviceAr = $serviceObj->get_service_info();
 $service_name = $serviceAr[0];
 //  get service from course
 $serviceinfoAr = $common_dh->get_service_info_from_course($id_course);
 if (AMA_DataHandler::isError($serviceinfoAr)) {
     $message = urlencode(translateFN('Impossibile richiedere il servizio'));
     $errObj = new ADA_Error($serviceinfoAr, $message, NULL, NULL, NULL, $error_page . '?message=' . $message);
     exit;
 }
 $start_date1 = 0;
 $start_date2 = AMA_DataHandler::date_to_ts("now");
 $days = $serviceinfoAr[4];
 $istanza_ha = array('data_inizio' => $start_date1, 'durata' => $days, 'data_inizio_previsto' => $start_date2, 'id_layout' => NULL);
 // add user to tester DB
 $id_tester_user = Multiport::setUser($userObj, $testersAr, $update_user_data = FALSE);
 if ($id_tester_user === FALSE) {
     $message = urlencode(translateFN("Error while assigning user to provider."));
     //  header('Location:'.$userObj->getHomepage($message));
     // exit();
 }
 // add an instance to tester db
 $res_inst_add = $tester_dh->course_instance_add($id_course, $istanza_ha);
 if (!AMA_DataHandler::isError($res_inst_add) or $res_inst_add->code == AMA_ERR_UNIQUE_KEY) {
     // we add an instance OR there already was one with same data
     // get an instance
     $clause = "id_corso = {$id_course} AND data_inizio_previsto = {$start_date2} AND durata  = {$days}";
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:subscribe.php

示例4: find_sub_services_data

 /**
  * get all services to which a given user has subscribed
  * @param  $ADAUser $userObj
  * @param  $field_list_ar array
  * @param  $clause string
  * @return $sub_course_dataHa array
  */
 public static function find_sub_services_data(ADAGenericUser $userObj, $field_ar, $clause, $orderBy = 'service')
 {
     $common_dh = $GLOBALS['common_dh'];
     $sub_course_dataHa = array();
     $user_id = $userObj->getId();
     /*
      * Obtain tester names
      */
     $tester_names = array();
     /*    foreach ($userObj->getTesters() as $tester) {
           $tester_dataHa = $common_dh->get_tester_info_from_pointer($tester);
           $tester_names[$tester] = $tester_dataHa[1];
         }
     */
     // foreach($userObj->getTesters() as $tester) { // only providers in which user is subscribed
     /*  $testers = $common_dh->get_all_testers(); // all providers
         foreach($testers as $testerItem){
       	  $tester = $testerItem['puntatore'];
     */
     $testerPointersAr = $common_dh->get_testers_for_user($user_id);
     // providers assigned to the user
     foreach ($testerPointersAr as $tester) {
         // ADALogger::log("MultiPort::find_sub_services_data for tester: $tester");
         $tester_dataHa = $common_dh->get_tester_info_from_pointer($tester);
         $tester_city = $tester_dataHa[5];
         $tester_country = $tester_dataHa[6];
         $tester_names[$tester] = $tester_dataHa[1];
         $tester_dsn = self::getDSN($tester);
         if ($tester_dsn != null) {
             //$tester_dataHa = $common_dh->get_tester_info_from_pointer($tester);
             //$tester_name = 'NOME TESTER';//$tester_dataHa[1];
             $tester_dh = AMA_DataHandler::instance($tester_dsn);
             if (!AMA_DataHandler::isError($tester_dh)) {
                 // versioneche cicla solo sulle istanze cui è pre/iscritto
                 $all_instance = $tester_dh->course_instance_student_presubscribe_get_status($user_id);
                 //  versioneche cicla su tutte le istanze
                 /* FIXME: bisogna fare una JOIN su iscrizione e istanze_corso !
                     	    $all_instance = $tester_dh->course_instance_find_list($field_ar,$clause);
                 			var_dump($all_instance);
                 			*/
             } else {
                 //var_dump($tester_dh);
                 $all_instance = "";
             }
             if (is_array($all_instance)) {
                 foreach ($all_instance as $one_instance) {
                     //	  var_dump($one_instance);
                     $history_link = " - ";
                     $toc = " - ";
                     $info = "- ";
                     $tutor = translateFN("Not assigned");
                     $tutor_link = $tutor;
                     $now = AMA_DataHandler::date_to_ts("now");
                     $id_course_instance = $one_instance['istanza_corso'];
                     $status = $one_instance['status'];
                     $one_course_instance = $tester_dh->course_instance_get($id_course_instance, true);
                     // GESTIRE ERRORE
                     $id_course = $one_course_instance['id_corso'];
                     $data_inizio = $one_course_instance['data_inizio'];
                     $durata = $one_course_instance['durata'];
                     // NOTE: qui sarebbe utile invece il conto dei giorni restanti...
                     $data_inizio_previsto = $one_course_instance['data_inizio_previsto'];
                     $data_fine = $one_course_instance['data_fine'];
                     $service_completed = $data_fine < $now;
                     $sub_courses = $tester_dh->get_subscription($user_id, $id_course_instance);
                     //      if ($sub_courses['tipo'] == 2) { introducing status 3 (removed) and 4 (visitors)
                     if (!AMA_dataHandler::isError($sub_courses)) {
                         //    if (($sub_courses['tipo'] == ADA_STATUS_SUBSCRIBED) OR ($sub_courses['tipo'] == 4)) {
                         /* hack: subscription state is not updated, so we use time from course instance data to show users' status*/
                         if ($service_completed && $sub_courses['tipo'] == ADA_SERVICE_SUBSCRIPTION_STATUS_ACCEPTED) {
                             $tipo = ADA_SERVICE_SUBSCRIPTION_STATUS_COMPLETED;
                         } else {
                             $tipo = $sub_courses['tipo'];
                         }
                         // filtering on completed services if $clause paratemer is passed
                         if (!$clause or $tipo != ADA_SERVICE_SUBSCRIPTION_STATUS_COMPLETED) {
                             //FIXME: we have to parse the clause !!!
                             $tutor_Id = $tester_dh->course_instance_tutor_get($id_course_instance);
                             if ($tutor_Id) {
                                 $tutorInfoHa = $tester_dh->get_tutor($tutor_Id);
                                 $tutor_link = '<a href="' . HTTP_ROOT_DIR . '/browsing/practitionerProfile.php?id=' . $tutor_Id . '">' . $tutorInfoHa['nome'] . ' ' . $tutorInfoHa['cognome'] . '</a>';
                             }
                             $course = $tester_dh->get_course($id_course);
                             if (is_array($course)) {
                                 $id_start = $id_course . "_" . $course['id_nodo_iniziale'];
                                 $home_label = translateFN("home");
                                 $titolo = translateFN($course['titolo']);
                                 $info = "<a href=" . $http_root_dir . "../info.php?id_course={$id_course}&norequest=1>{$titolo}</a>";
                                 $start_date = ts2dFN($data_inizio_previsto);
                             }
                             // mod steve 17/12/09 suspended while wating for  history module
                             // $history_link = "<a href='".HTTP_ROOT_DIR."/browsing/service_info.php?norequest=1&id_course=$id_course&id_course_instance=$id_course_instance'>$start_date</a>";
                             $nome = $course['nome'];
//.........这里部分代码省略.........
开发者ID:eguicciardi,项目名称:ada,代码行数:101,代码来源:multiport.inc.php


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