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


PHP project::save方法代码示例

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


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

示例1: strtolower

# new_project.php
# 1. logic
AUTH::kickout('login');
$projects = new Projects_Collection();
$projects->where(['deleted' => '0']);
$projects->where(['user_id' => AUTH::user_id()]);
$projects->get();
if (Input::posted()) {
    $slug = Input::get('project_name');
    $slug = strtolower($slug);
    $slug = explode(" ", $slug);
    $slug = implode("-", $slug);
    $deadline = Input::get('deadline');
    $deadline = intval($deadline);
    $project = new project();
    $project->fill(Input::all());
    $project->date = date('Y-m-d H:i:s');
    $project->slug = $slug;
    $project->user_id = Auth::user_id();
    if (Input::get('project_name') != "" || Input::get('project_description') != "") {
        $project->save();
        URL::redirect('/' . $project->slug);
    }
    URL::redirect('/new_project');
}
$title = 'New Project';
# 2. views
include VIEWS . 'header.php';
include VIEWS . 'new_project.php';
include VIEWS . 'footer.php';
开发者ID:Wade-Nairn,项目名称:get-it-done-WE04,代码行数:30,代码来源:new_project.php

示例2: foreach

                             }
                             if ($_POST['question_t2_answer']) {
                                 // Update tariffs with new end date
                                 if ($_POST['projects_end_date'] > $administration_project->end_date && $administration_project->end_date != 0 || $_POST['projects_end_date'] == 0) {
                                     $tariffs_array = $administration_project->has_tariffs('tariffs_end_date', '=', tep_strftime(DATE_FORMAT_DATABASE, $administration_project->end_date));
                                 } else {
                                     $tariffs_array = $administration_project->has_tariffs('tariffs_start_date', '<=', tep_strftime(DATE_FORMAT_DATABASE, $_POST['projects_end_date']), 'AND', 'tariffs_end_date', '>', tep_strftime(DATE_FORMAT_DATABASE, $_POST['projects_end_date']));
                                 }
                                 for ($index = 0; $index < sizeof($tariffs_array); $index++) {
                                     $tariffs_array[$index]->end_date = $_POST['projects_end_date'];
                                     $tariffs_array[$index]->save();
                                 }
                             }
                             // Finally save the project
                             $administration_project->fill($_POST['projects_name'], $_POST['projects_description'], $_POST['projects_customers_contact_name'], $_POST['projects_customers_reference'], $_POST['projects_start_date'], $_POST['projects_end_date'], $_POST['projects_calculated_hours'], $_POST['projects_calculated_hours_period'], $_POST['projects_business_units_id'], $_POST['projects_customers_id']);
                             $administration_project->save();
                             // Clear all values except mPath
                             foreach ($_POST as $key => $value) {
                                 if ($key != 'mPath') {
                                     unset($_POST[$key]);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     break;
 case 'delete_entry':
     // Check for dependencies
开发者ID:BackupTheBerlios,项目名称:bitts-svn,代码行数:31,代码来源:administration_projects.php

示例3: project

 if ($_POST["delete"]) {
     $project->read_globals();
     $project->delete();
     alloc_redirect($TPL["url_alloc_projectList"]);
     // If they are creating a new project that is based on an existing one
 } else {
     if ($_POST["copy_project_save"] && $_POST["copy_projectID"] && $_POST["copy_project_name"]) {
         $p = new project();
         $p->set_id($_POST["copy_projectID"]);
         if ($p->select()) {
             $p2 = new project();
             $p2->read_row_record($p->row());
             $p2->set_id("");
             $p2->set_value("projectName", $_POST["copy_project_name"]);
             $p2->set_value("projectShortName", "");
             $p2->save();
             $TPL["message_good"][] = "Project details copied successfully.";
             // Copy project people
             $q = prepare("SELECT * FROM projectPerson WHERE projectID = %d", $p->get_id());
             $db = new db_alloc();
             $db->query($q);
             while ($row = $db->row()) {
                 $projectPerson = new projectPerson();
                 $projectPerson->currency = $p->get_value("currencyTypeID");
                 $projectPerson->read_row_record($row);
                 $projectPerson->set_id("");
                 $projectPerson->set_value("projectID", $p2->get_id());
                 $projectPerson->save();
                 $TPL["message_good"]["projectPeople"] = "Project people copied successfully.";
             }
             // Copy commissions
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:project.php

示例4: create_project

 /**
  * Create a new project
  *
  * @param  array  $input
  * @return array
  */
 public static function create_project($input)
 {
     $rules = array('name' => 'required|max:250');
     $validator = \Validator::make($input, $rules);
     if (!$validator->valid()) {
         return array('success' => false, 'errors' => $validator);
     }
     $fill = array('name' => $input['name']);
     $project = new project();
     $project->fill($fill);
     $project->save();
     /* Assign selected users to the project */
     if (isset($input['user']) && count($input['user']) > 0) {
         foreach ($input['user'] as $id) {
             $project->assign_user($id);
         }
     }
     return array('project' => $project, 'success' => true);
 }
开发者ID:neosin,项目名称:tinyissue,代码行数:25,代码来源:project.php


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