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

PHP today函数代码示例

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

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



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

示例1: show_form

 function show_form()
 {
     global $form_do_demande, $dbh, $charset;
     $date = formatdate(today());
     $date_fin = date("Ymd", time());
     //Selecteur des thèmes
     $req = "select * from demandes_theme order by libelle_theme";
     $res = mysql_query($req, $dbh);
     $theme_selector = "<select name='idtheme' >";
     while ($dmde = mysql_fetch_object($res)) {
         $theme_selector .= "<option value='" . $dmde->id_theme . "'>" . htmlentities($dmde->libelle_theme, ENT_QUOTES, $charset) . "</option>";
     }
     $theme_selector .= "</select>";
     //Selecteur des types
     $req = "select * from demandes_type order by libelle_type";
     $res = mysql_query($req, $dbh);
     $type_selector = "<select name='idtype' >";
     while ($dmde = mysql_fetch_object($res)) {
         $type_selector .= "<option value='" . $dmde->id_type . "'>" . htmlentities($dmde->libelle_type, ENT_QUOTES, $charset) . "</option>";
     }
     $type_selector .= "</select>";
     $form_do_demande = str_replace('!!date_fin!!', $date_fin, $form_do_demande);
     $form_do_demande = str_replace('!!date_fin_btn!!', $date, $form_do_demande);
     $form_do_demande = str_replace('!!select_theme!!', $theme_selector, $form_do_demande);
     $form_do_demande = str_replace('!!select_type!!', $type_selector, $form_do_demande);
     print $form_do_demande;
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:27,代码来源:demandes.class.php


示例2: show_form

 function show_form($param = '')
 {
     global $base_path, $dbh, $charset, $msg;
     //paramètres pré-enregistré
     $liste_views = array();
     if ($param['list_view']) {
         foreach ($param['list_view'] as $id_view) {
             $liste_views[$id_view] = $id_view;
         }
     }
     $conso = $param["conso"] ? $param["conso"] : "1";
     $date_deb = $param["date_deb"];
     $date_fin = $param["date_fin"];
     $date_ech = $param["date_ech"];
     $requete = "SELECT id_vue, date_consolidation, nom_vue, comment FROM statopac_vues";
     $res = mysql_query($requete, $dbh);
     $nb_rows = mysql_num_rows($res);
     //taille du selecteur
     if ($nb_rows < 3) {
         $nb = 3;
     } else {
         if ($nb_rows > 10) {
             $nb = 10;
         } else {
             $nb = $nb_rows;
         }
     }
     $select_view = "<select id='list_view' class='saisie-50em' name='list_view[]' size='" . $nb . "' multiple>";
     while ($row = mysql_fetch_object($res)) {
         $select_view .= "<option id='" . $row->id_vue . "' value='" . $row->id_vue . "' " . ($liste_views[$row->id_vue] == $row->id_vue ? "selected" : "") . ">" . htmlentities($row->nom_vue, ENT_QUOTES, $charset) . "</option>";
     }
     $select_view .= "</select>";
     //liste des vues à consolider
     $form_task .= "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='stats'>" . $this->msg["planificateur_stats_listView"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>" . $select_view . "</div>\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     /*appui sur la fin de la méthode do_form de la classe stat_view*/
     $form_task .= "<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='stats'>" . $this->msg["planificateur_stats_options"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>\n\t\t\t\t<input type='radio' class='radio' id='id_lot' name='conso' value='1' " . ($conso == "1" ? "checked" : "") . "/> \n\t\t\t\t\t<label for='id_lot'>{$msg['stat_last_consolidation']}</label> <br><br>\n\t\t\t\t<input type='radio' class='radio' id='id_interval' name='conso' value='2' " . ($conso == "2" ? "checked" : "") . "/> \n\t\t\t\t\t<label for='id_interval'>{$msg['stat_interval_consolidation']} </label><br><br>\n\t\t\t\t<input type='radio' class='radio' id='id_debut' name='conso' value='3' " . ($conso == "3" ? "checked" : "") . "/> \n\t\t\t\t\t<label for='id_debut'>{$msg['stat_echeance_consolidation']}</label><br>\n\t\t\t</div>\n\t\t</div>";
     $btn_date_deb = "<input type='hidden' name='date_deb' value='!!date_deb!!'/><input type='button' name='date_deb_lib' class='bouton_small' value='!!date_deb_lib!!'   \n\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=planificateur_form&date_caller=!!date_deb!!&param1=date_deb&param2=date_deb_lib&auto_submit=NO&date_anterieure=YES', 'date_deb', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />";
     $btn_date_fin = "<input type='hidden' name='date_fin' value='!!date_fin!!'/><input type='button' name='date_fin_lib' class='bouton_small'   value='!!date_fin_lib!!'\n\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=planificateur_form&date_caller=!!date_fin!!&param1=date_fin&param2=date_fin_lib&auto_submit=NO&date_anterieure=YES', 'date_fin', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />";
     $btn_date_echeance = "<input type='hidden' name='date_ech' value='!!date_ech!!'/><input type='button' name='date_ech_lib' class='bouton_small' value='!!date_ech_lib!!'  \n\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=planificateur_form&date_caller=!!date_ech!!&param1=date_ech&param2=date_ech_lib&auto_submit=NO&date_anterieure=YES', 'date_ech', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" />";
     if (!$date_deb) {
         // -- si nouvelle tâche = pas de params pré-enregistrés
         $date_deb = strftime("%Y-%m-%d", mktime(0, 0, 0, date('m'), date('d') - 1, date('y')));
     }
     $btn_date_deb = str_replace("!!date_deb!!", $date_deb, $btn_date_deb);
     $btn_date_deb = str_replace("!!date_deb_lib!!", formatdate($date_deb), $btn_date_deb);
     if (!$date_fin) {
         $date_fin = today();
     }
     $btn_date_fin = str_replace("!!date_fin!!", $date_fin, $btn_date_fin);
     $btn_date_fin = str_replace("!!date_fin_lib!!", formatdate($date_fin), $btn_date_fin);
     if (!$date_ech) {
         $date_ech = today();
     }
     $btn_date_echeance = str_replace("!!date_ech!!", $date_ech, $btn_date_echeance);
     $btn_date_echeance = str_replace("!!date_ech_lib!!", formatdate($date_ech), $btn_date_echeance);
     $form_task = str_replace("!!date_deb_btn!!", $btn_date_deb, $form_task);
     $form_task = str_replace("!!date_fin_btn!!", $btn_date_fin, $form_task);
     $form_task = str_replace("!!echeance_btn!!", $btn_date_echeance, $form_task);
     return $form_task;
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:60,代码来源:stats.class.php


示例3: bodyBottom

function bodyBottom()
{
    global $TimerStart, $prog_name_full, $prog_ver;
    $today = today();
    $genTime = processTime();
    echo "\n</td>\n        </tr>\n      </table></td>\n  </tr>\n  <tr>\n    <td height=\"32\"><table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n        <tr>\n          <td height=\"1\" bgcolor=\"#7D7D7D\"></td>\n        </tr>\n        <tr>\n          <td><table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#EAEAEA\" class=\"bottomBar\">\n              <tr>\n                <td width=\"30%\" class=\"bottomInfo\">" . _GENERATION_TIME . " {$genTime} " . _SECONDS . "</td>\n                <td class=\"bottomInfo\">\n                <div align=\"center\">Powered by <a href  >{$prog_name_full}</a> {$prog_ver} &copy; 2007</div></td>\n                <td width=\"30%\" class=\"bottomInfo\">\n                <div align=\"right\">" . _NOW . ": {$today}</div></td>\n              </tr>\n            </table></td>\n        </tr>\n        <tr>\n          <td height=\"1\" bgcolor=\"#7D7D7D\"></td>\n        </tr>\n      </table></td>\n  </tr>\n</table>\n\n\n</body>\n</html>";
}
开发者ID:Raxman,项目名称:stis,代码行数:7,代码来源:theme.php


示例4: index

 public function index()
 {
     $myID = getUserID();
     $title = trim(jsonInput('title'));
     $description = jsonInput('description');
     $location = jsonInput('location');
     $start = strtotime(jsonInput('start'));
     $end = strtotime(jsonInput('end'));
     if (empty($title)) {
         generate_json(array('status' => 0, 'message' => 'Please type event title.'));
     } else {
         if (!$start) {
             generate_json(array('status' => 0, 'message' => 'Start Date is required.'));
         } else {
             if ($end && $start > $end) {
                 generate_json(array('status' => 0, 'message' => 'Dates mismatch.'));
             } else {
                 $start = date("Y-m-d", $start);
                 $end = $end ? date("Y-m-d", $end) : $start;
                 $this->mdb->add_event(array('title' => $title, 'description' => $description, 'location' => $location, 'type' => 'default', 'start' => $start, 'end' => $end, 'date_added' => today(), 'source' => 'local', 'user_id' => $myID));
                 generate_json(array('status' => 1));
             }
         }
     }
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:25,代码来源:Add_event.php


示例5: do_login

 public function do_login()
 {
     $username = $this->input->post('username');
     $password = ts_hash($this->input->post('password'));
     $status = 1;
     $message = '';
     $query = $this->model->login($username, $password);
     if ($query->num_rows()) {
         $row = $query->row();
         switch ($row->status) {
             case 0:
                 $status = 0;
                 $message = sprintf('Account not yet verified. <br /><a href="%s">Resend Verification?</a>', base_url('signup/resend_verification?token=' . $row->token . '&t=' . strtotime('now')));
                 break;
             case 2:
                 $status = 0;
                 $message = 'This account has been banned.';
                 break;
             default:
                 $uniqueToken = random_string('unique');
                 $this->model->user_update(array('last_active' => today(), 'token' => $uniqueToken), array('id' => $row->id));
                 $sessData = array('user_id' => $row->id, 'username' => $row->username, 'userlevel' => $row->userlevel, 'display_name' => $row->display_name, 'email_address' => $row->email_address, 'token' => $uniqueToken);
                 $this->session->set_userdata($sessData);
                 $message = $uniqueToken;
         }
     } else {
         $status = 0;
         $message = 'Incorrect Username / Password.';
     }
     generate_json(array('status' => $status, 'message' => $message));
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:31,代码来源:Login.php


示例6: gl_inquiry_controls

function gl_inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    check_cells(_("No zero values"), 'NoZero', null);
    check_cells(_("Only balances"), 'Balance', null);
    submit_cells('Show', _("Show"), '', '', 'default');
    end_table();
    end_form();
}
开发者ID:raqib,项目名称:ac_dev,代码行数:26,代码来源:gl_trial_balance.php


示例7: __construct

 public function __construct()
 {
     parent::__construct();
     if (empty($this->date)) {
         $this->date = today();
     }
 }
开发者ID:vivek201,项目名称:canteen-mgmt,代码行数:7,代码来源:order.class.php


示例8: error401

function error401()
{
    require_once 'russian.php';
    global $mail, $prog_name_full, $prog_ver;
    $today = today();
    $server = $_SERVER['HTTP_HOST'];
    echo "\n<html>\n<head>\n<title>{$prog_name}: " . Authentication_required . "!</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=KOI8-R\" />\n<style type=\"text/css\">\n<!--\nbody { \n    color: #000000; background-color: #FFFFFF; \n    font-family: Arial, Helvetica, sans-serif;\n    font-size: 14px;\n}\na:link { color: #0000CC; }\n-->\n</style>\n</head>\n\n<body>\n<h1><font font size=\"7\">" . Authentication_required . "!</font></h1>\n<HR noshade size=1px>\n<dl>\n<dd>\n\n\n    This server could not verify that you are authorized to access\n    the URL.\n    You either supplied the wrong credentials (e.g., bad password), or your\n    browser doesn't understand how to supply the credentials required.\n\n  </dd></dl><dl><dd>\n\n\n    In case you are allowed to request the document, please\n    check your user-id and password and try again.\n\n</dd></dl><dl><dd>\nIf you think this is a server error, please contact\nthe <a href=\"mailto:{$mail}\">{$mail}</a>\n\n</dd></dl>\n\n<h2><font font size=\"6\">" . _ERROR . " 401</font></h2>\n<HR noshade size=1px>\n<dl>\n<dd>\n<address>\n  <a href=\"/\">{$server}</a>\n  <br />\n\n  <small>{$today}</small>\n  <br />\n  <small>{$prog_name_full} {$prog_ver}</small>\n</address>\n</dd>\n</dl>\n</body>\n</html>\n";
}
开发者ID:Raxman,项目名称:stis,代码行数:8,代码来源:functions.php


示例9: do_signup

 private function do_signup()
 {
     if ($_POST) {
         $username = $this->input->post('username');
         $fullname = $this->input->post('fullname');
         $email = $this->input->post('email');
         $gender = $this->input->post('gender');
         $password = $this->input->post('password');
         $password2 = $this->input->post('password2');
         $alertMsg = '';
         $this->form_validation->set_rules('username', 'Username', 'required|trim|alpha_numeric|min_length[4]|max_length[20]|is_unique[users.username]');
         $this->form_validation->set_rules('fullname', 'Display name', 'required|alpha_numeric_spaces|max_length[30]');
         $this->form_validation->set_rules('email', 'Email address', 'required|valid_email|is_unique[users.email_address]');
         $this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[20]');
         $this->form_validation->set_rules('password2', 'Confirm Password', 'matches[password]');
         $this->form_validation->set_message('required', '%s is required.');
         $this->form_validation->set_message('alpha_numeric', '%s must be alpha numeric only.');
         $this->form_validation->set_message('alpha_numeric_spaces', '%s must be letters, numbers and spaces only.');
         $this->form_validation->set_message('valid_email', 'Invalid %s.');
         $this->form_validation->set_message('is_unique', '%s already exists.');
         $this->form_validation->set_message('min_length', '%s must contain atleast %d characters.');
         $this->form_validation->set_message('max_length', '%s too long, allowed up to %d characters only.');
         $this->form_validation->set_message('matches', 'Passwords do not match.');
         $this->form_validation->set_error_delimiters('', '|');
         if ($this->form_validation->run()) {
             $emailVerification = $this->siteinfo->config('signup_verification');
             /* SUCCESS MESSAGE */
             $successMsg = array(sprintf('<div class="alert alert-success">Thank you for joining %s we are happy to have you here. You can now <a href="%s">Login</a>.</div>', ucfirst($this->siteinfo->config('site_name')), base_url()), '<div class="alert alert-danger">Thanks for joining, We have send you an email confirmation to validate your account.</div>');
             $alertMsg .= $emailVerification ? $successMsg[1] : $successMsg[0];
             /* SUCCESS MESSAGE END */
             //Inserts to database
             $mData = array('userlevel' => 0, 'username' => $username, 'email_address' => $email, 'password' => ts_hash($password), 'display_name' => $fullname, 'date_registered' => today(), 'last_active' => NULL, 'status' => $emailVerification ? 0 : 1, 'token' => random_string('unique'));
             $newID = $this->mdb->users_add($mData);
             $genders = $this->config->item('genders');
             if ($newID) {
                 $this->mdb->users_info_add(array('user_id' => $newID, 'firstname' => '', 'middlename' => '', 'lastname' => '', 'gender' => in_array($gender, $genders) ? $gender : $genders[0], 'timezone' => $this->siteinfo->config('timezone'), 'location' => '', 'contact_number' => '', 'company' => '', 'profile_pic' => '', 'email_privacy' => 1));
             }
             //Process Email Notification
             if ($emailVerification) {
             }
             //Clear fields after Success
             $username = '';
             $fullname = '';
             $email = '';
             $password = '';
             $password2 = '';
         } else {
             $errors = validation_errors();
             $errorsArr = explode("|", $errors);
             $alertMsg = '<div class="alert alert-warning">';
             $alertMsg .= isset($errorsArr[0]) ? $errorsArr[0] : 'Unknown error!';
             $alertMsg .= '</div>';
         }
         return array('alert_msg' => $alertMsg, 'username' => htmlentities($username), 'fullname' => htmlentities($fullname), 'email' => htmlentities($email), 'password' => htmlentities($password), 'password2' => htmlentities($password2));
     }
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:56,代码来源:Signup.php


示例10: date_ago

function date_ago($date)
{
    switch ($date->diff(today())->days) {
        case 0:
            return \Lang::get('pages.updates.today');
            break;
        case 1:
            return \Lang::get('pages.updates.yesterday');
            break;
    }
    return $date->ago();
}
开发者ID:ankhzet,项目名称:Ankh,代码行数:12,代码来源:view.php


示例11: index

 public function index()
 {
     $myID = getUserID();
     $date = today();
     $title = trim(jsonInput('title'));
     $content = jsonInput('content');
     $category = trim(jsonInput('category'));
     if (empty($title)) {
         generate_json(array('status' => 0, 'message' => 'Title is required.'));
     } else {
         $insert_id = $this->mdb->insert_note(array('user_id' => $myID, 'title' => $title, 'content' => $content, 'category' => $category, 'date_created' => $date));
         generate_json(array('status' => 1, 'message' => 'Note successfully created.'));
     }
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:14,代码来源:Create.php


示例12: index

 public function index()
 {
     $myID = getUserID();
     $query = $this->mdb->get_notif($myID, today());
     $items = array();
     foreach ($query->result() as $row) {
         $tagData = explode("|", $row->tag_data);
         $description = display_notif($row->type, $tagData, $row->counter);
         $description = convert_tag($description, 'span', array('class' => 'tag'));
         $dateNotify = convert_datetime($row->date_notify);
         $items[] = array('id' => $row->id, 'description' => $description, 'actor_id' => $row->actor_id, 'redirect_uri' => $row->redirect, 'timestamp' => relativedate(strtotime($dateNotify), true), 'is_read' => $row->is_read, 'is_new' => $row->is_new);
     }
     $this->mdb->update_notif(array('notify_to' => $myID, 'is_new' => 1), array('is_new' => 0));
     generate_json(array('status' => 1, 'items' => $items));
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:15,代码来源:Notification.php


示例13: getLast12Months

function getLast12Months($format = "%b %Y")
{
    $currentDate = today();
    $currentMonth = formatDate($currentDate, "%m");
    $currentYear = formatDate($currentDate, "%Y");
    $startingYear = $currentYear - 1;
    $last_12_months = array();
    for ($i = (int) $currentMonth + 1; $i <= 12; $i++) {
        $last_12_months[] = formatDate($startingYear . "-" . $i . "-01", $format);
    }
    for ($i = 1; $i <= $currentMonth; $i++) {
        $last_12_months[] = formatDate($currentYear . "-" . $i . "-01", $format);
    }
    return $last_12_months;
}
开发者ID:nveeed,项目名称:ems,代码行数:15,代码来源:DateTimeHelper.php


示例14: index

 public function index()
 {
     $myID = getUserID();
     $name = trim(jsonInput('name'));
     $description = jsonInput('description');
     $membersPost = jsonInput('members');
     $this->np_validations();
     $newProjID = $this->mdb->project_add($myID, $name, $description);
     if ($newProjID) {
         //add yourself in project members
         $this->mdb->project_member_add(array('project_id' => $newProjID, 'user_id' => $myID, 'email_address' => getUserEmail(), 'joined_by' => 0, 'date_joined' => today(), 'last_visit' => today(), 'is_accepted' => 1, 'project_role' => 3));
         $this->mdb->add_project_settings(array('project_id' => $newProjID, 'task_approval' => 0, 'project_approval' => 1));
         //add specified members to project
         if (is_array($membersPost)) {
             foreach ($membersPost as $member) {
                 if (filter_var($member, FILTER_VALIDATE_EMAIL)) {
                     $qChkifAlreadyMember = $this->mdb->checkIfAlreadyMember($newProjID, $member);
                     if (!$qChkifAlreadyMember) {
                         $qChkUser = $this->model->getUserInfo(array('email_address' => $member));
                         if ($qChkUser->num_rows()) {
                             $pmRow = $qChkUser->row();
                             $this->mdb->project_member_add(array('project_id' => $newProjID, 'user_id' => $pmRow->id, 'email_address' => $pmRow->email_address, 'joined_by' => $myID, 'date_joined' => today(), 'last_visit' => NULL, 'is_accepted' => 0, 'project_role' => $this->siteinfo->config('project_roles_default')));
                             //notification
                             notify('project_invite', $pmRow->id, array('project_id' => $newProjID));
                             $qProj = $this->db->get_where('projects', array('id' => $newProjID));
                             if ($qProj->num_rows()) {
                                 $qProjRow = $qProj->row();
                                 $myName = $this->session->userdata('display_name');
                                 $redirectLink = base_url('#/app/projects/' . $newProjID);
                                 do_sendmail($pmRow->id, $qProjRow->project_name, "{$myName} invited you to join <a href='{$redirectLink}'>" . $qProjRow->project_name . "</a>");
                             }
                         } else {
                             $this->mdb->project_member_add(array('project_id' => $newProjID, 'user_id' => 0, 'email_address' => $member, 'joined_by' => $myID, 'date_joined' => today(), 'last_visit' => NULL, 'is_accepted' => 0, 'project_role' => $this->siteinfo->config('project_roles_default')));
                         }
                     }
                 }
             }
         }
         //add project roles
         foreach ($this->siteinfo->config('project_roles') as $roleID => $role) {
             $default = $this->siteinfo->config('project_roles_default') == $roleID ? 1 : 0;
             $this->mdb->project_roles_add($newProjID, $roleID, $default, $role);
         }
     }
     generate_json(array('status' => 1, 'message' => 'New project has been created.'));
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:46,代码来源:New_project.php


示例15: index

 public function index()
 {
     updateLastActive();
     $myID = getUserID();
     $filepath = 'uploads/files/' . $myID . '/';
     $pid = (int) $this->input->get('pid');
     $tid = (int) $this->input->get('tid');
     if (!file_exists($filepath)) {
         mkdir($filepath, 0777, true);
     }
     if (!validate_access('valid_member', array('project_id' => $pid, 'user_id' => $myID))) {
         $this->output->set_status_header('400');
         echo 'You dont have enough permission to do this.';
     } else {
         $config['upload_path'] = $filepath;
         $config['allowed_types'] = 'jpg|gif|jpeg|bmp|ico|png|zip|rar|gz|mp3|mp4|mkv|avi|txt|apk|ipa|tar|exe|doc|docx|xls|xlsx|ppt|pptx|pdf';
         $config['max_size'] = 30000;
         $config['encrypt_name'] = true;
         $config['max_filename'] = 200;
         $config['remove_spaces'] = false;
         $this->load->library('upload', $config);
         if ($this->upload->do_upload('file')) {
             $data = $this->upload->data();
             $newID = $this->mdb->add_attachment(array('attachment_type' => 'file', 'uploader' => $myID, 'project_id' => $pid, 'task_id' => $tid, 'post_id' => 0, 'filename' => $data['orig_name'], 'filepath' => $data['file_name'], 'filesize' => $data['file_size'] * 1024, 'extension' => $data['file_ext'], 'date_added' => today(), 'date_deleted' => null, 'deleted_by' => 0, 'parent_folder' => 0));
             $imgTypes = array('.gif', '.jpg', '.jpeg', '.png');
             if (in_array(strtolower($data['file_ext']), $imgTypes)) {
                 $this->load->library('image_lib');
                 $thumbpath = $filepath . 'thumbs/';
                 if (!file_exists($thumbpath)) {
                     mkdir($thumbpath, 0777, true);
                 }
                 $config = array('image_library' => 'gd2', 'source_image' => $filepath . $data['file_name'], 'new_image' => $thumbpath . $data['file_name'], 'maintain_ratio' => true, 'height' => 300, 'width' => 300);
                 $this->image_lib->initialize($config);
                 $this->image_lib->resize();
                 $this->image_lib->clear();
             }
             echo $newID;
         } else {
             $errors = $this->upload->display_errors('', '|');
             $errorsArr = explode("|", $errors);
             $this->output->set_status_header('401');
             echo isset($errorsArr[0]) ? $errorsArr[0] : '';
         }
     }
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:45,代码来源:Upload.php


示例16: inquiry_controls

function inquiry_controls()
{
    global $Ajax;
    $dim = get_company_pref('use_dimension');
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    type_list_cells(_("Category: "), 'typeId', null, true);
    $r = set();
    account_list_cells(_(""), 'accountId', $r);
    submit_cells('submit_submit', _("Generate Report"), true, '', 'default');
    //submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), 'default');
    end_table();
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:21,代码来源:subsidiary_ledger_2.php


示例17: calcul_next_exec

 function calcul_next_exec($num_planificateur)
 {
     global $dbh;
     $sql = "SELECT id_planificateur, num_type_tache, libelle_tache, perio_heure, perio_minute, perio_jour_mois, perio_jour, perio_mois \n\t\t\t\tFROM planificateur WHERE id_planificateur=" . $num_planificateur;
     $res = mysql_query($sql, $dbh);
     if ($res) {
         while ($obj_sql = mysql_fetch_object($res)) {
             //renseignements Jour J
             $date_du_jour = getdate();
             //utile pour le calcul de l'heure et de la minute
             $date_today = $date_du_jour["year"] . "-" . $date_du_jour["mon"] . "-" . $date_du_jour["mday"];
             //renvoit 1 si année bissextile, 0 sinon
             $annee_bissextile = date('L', today());
             //Valeurs bdd
             $jour_mois_bdd = explode(',', $obj_sql->perio_jour_mois);
             $jour_semaine_bdd = explode(',', $obj_sql->perio_jour);
             $mois_bdd = explode(',', $obj_sql->perio_mois);
             $heure_bdd = $obj_sql->perio_heure;
             $minute_bdd = $obj_sql->perio_minute;
             $this->calcul_date($jour_semaine_bdd, $jour_mois_bdd, $mois_bdd);
             //calcul de la minute
             $this->calcul_minute_exec($minute_bdd, $date_today, $date_du_jour, $jour_semaine_bdd, $mois_bdd, $jour_mois_bdd);
             //calcul de l'heure
             $this->calcul_heure_exec($heure_bdd, $date_today, $date_du_jour, $jour_semaine_bdd, $mois_bdd, $jour_mois_bdd);
             //la date calculée est identique à la date du jour
             if ($date_du_jour["year"] == $this->new_date["ANNEE"] && $date_du_jour["mon"] == $this->new_date["MOIS"] && $date_du_jour["mday"] == $this->new_date["JOUR"]) {
                 //formatage de l'heure calculée
                 $this->new_date["HEURE"] = strlen($this->new_date["HEURE"]) == "1" ? "0" . $this->new_date["HEURE"] : $this->new_date["HEURE"];
                 $this->new_date["MINUTE"] = strlen($this->new_date["MINUTE"]) == "1" ? "0" . $this->new_date["MINUTE"] : $this->new_date["MINUTE"];
                 if ($this->new_date["HEURE"] == $date_du_jour["hours"] && $this->new_date["MINUTE"] == $date_du_jour["minutes"]) {
                     $this->recalcule_date($jour_semaine_bdd, $mois_bdd, $jour_mois_bdd);
                 }
             }
             //formatage de l'heure calculée
             $this->new_date["HEURE"] = strlen($this->new_date["HEURE"]) == "1" ? "0" . $this->new_date["HEURE"] : $this->new_date["HEURE"];
             $this->new_date["MINUTE"] = strlen($this->new_date["MINUTE"]) == "1" ? "0" . $this->new_date["MINUTE"] : $this->new_date["MINUTE"];
         }
     }
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:39,代码来源:tache_calendar.class.php


示例18: index

 public function index()
 {
     $myID = getUserID();
     $myEmail = getUserEmail();
     $pID = (int) $this->input->get('id');
     $visitorType = visitor_type($pID, $myID);
     $query = $this->mdb->project_get($pID);
     if ($query->num_rows()) {
         $row = $query->row();
         switch ($visitorType) {
             case 'guest':
                 $is_accepted = 1;
                 $projSett = $this->mdb->projSettings_get($row->id);
                 if ($projSett->num_rows()) {
                     $projSettRow = $projSett->row();
                     $is_accepted = (int) $projSettRow->project_approval ? 0 : 1;
                 }
                 $this->mdb->project_member_add(array('project_id' => $row->id, 'user_id' => $myID, 'email_address' => $myEmail, 'joined_by' => 0, 'date_joined' => today(), 'last_visit' => NULL, 'is_accepted' => $is_accepted, 'project_role' => $this->siteinfo->config('project_roles_default')));
                 generate_json(array('status' => 1));
                 break;
             case 'invited':
                 $this->mdb->project_member_update(array('project_id' => $row->id, 'user_id' => $myID), array('is_accepted' => 1));
                 projectLogs_add('member_new', $pID, array('user_id' => $myID, 'user_name' => $this->session->userdata('display_name')));
                 generate_json(array('status' => 1));
                 break;
             case 'member':
                 generate_json(array('status' => 0, 'message' => 'You are already a member of this project.'));
                 break;
             case 'requesting':
                 generate_json(array('status' => 1));
                 break;
             default:
                 generate_json(array('status' => 1, 'message' => 'Unknown Error.'));
         }
     } else {
         generate_json(array('status' => 0, 'message' => 'Project does not exists.'));
     }
 }
开发者ID:rodino25,项目名称:tsv2,代码行数:38,代码来源:Join.php


示例19: attribuer

 function attribuer()
 {
     global $chk, $iduser, $dbh;
     for ($i = 0; $i < count($chk); $i++) {
         $req = "insert into demandes_users set num_user={$iduser}, num_demande={$chk[$i]}, date_creation='" . today() . "', users_statut=1";
         mysql_query($req, $dbh);
     }
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:8,代码来源:demandes.class.php


示例20: show_form_sug

function show_form_sug($update_action)
{
    global $dbh, $msg, $charset;
    global $id_bibli, $id_sug;
    global $sug_map;
    global $sug_modif_form;
    global $acquisition_poids_sugg, $lk_url_sug;
    global $acquisition_sugg_categ, $acquisition_sugg_categ_default;
    global $orig_form_mod;
    global $orig_champ_modif;
    global $id_notice;
    global $acquisition_sugg_localises;
    global $deflt_docs_location;
    global $sugg_location_id;
    global $javascript_path;
    $form = $sug_modif_form;
    //Récupération des pondérations de suggestions
    $tab_poids = explode(",", $acquisition_poids_sugg);
    $tab_poids[0] = substr($tab_poids[0], 2);
    //utilisateur
    $tab_poids[1] = substr($tab_poids[1], 2);
    //abonné
    $tab_poids[2] = substr($tab_poids[2], 2);
    //visiteur
    if (!$id_sug) {
        //Création de suggestion
        $titre = htmlentities($msg['acquisition_sug_cre'], ENT_QUOTES, $charset);
        //Récupération de l'utilisateur
        $requete_user = "SELECT userid, nom, prenom FROM users where username='" . SESSlogin . "' limit 1 ";
        $res_user = pmb_mysql_query($requete_user, $dbh);
        $row_user = pmb_mysql_fetch_row($res_user);
        $orig = $row_user[0];
        $lib_orig = $row_user[1];
        if ($row_user[2]) {
            $lib_orig .= $row_user[2] . ", " . $row_user[1];
        }
        $form = str_replace('!!lib_orig!!', $orig_form_mod, $form);
        $form = str_replace('!!dat_cre!!', formatdate(today()), $form);
        $form = str_replace('!!orig!!', $orig, $form);
        $form = str_replace('!!lib_orig!!', htmlentities($lib_orig, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!typ!!', '0', $form);
        $form = str_replace('!!poi!!', $tab_poids[0], $form);
        $form = str_replace('!!poi_tot!!', $tab_poids[0], $form);
        $statut = $sug_map->getFirstStateId();
        $form = str_replace('!!statut!!', $statut, $form);
        $form = str_replace('!!lib_statut!!', $sug_map->getHtmlComment($statut), $form);
        $form = str_replace('!!list_user!!', '', $form);
        $form = str_replace('!!creator_ajout!!', '', $form);
        $form = str_replace('!!lien!!', '', $form);
        if ($acquisition_sugg_categ != '1') {
            $sel_categ = "";
        } else {
            if (suggestions_categ::exists($acquisition_sugg_categ_default)) {
                $sugg_categ = new suggestions_categ($acquisition_sugg_categ_default);
            } else {
                $sugg_categ = new suggestions_categ('1');
            }
            $tab_categ = suggestions_categ::getCategList();
            $sel_categ = "<select class='saisie-25em' id='num_categ' name='num_categ'>";
            foreach ($tab_categ as $id_categ => $lib_categ) {
                $sel_categ .= "<option value='" . $id_categ . "' ";
                if ($id_categ == $sugg_categ->id_categ) {
            

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP todolista函数代码示例发布时间:2022-05-23
下一篇:
PHP todate函数代码示例发布时间: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