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


PHP project::fill方法代码示例

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


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

示例1: project

<h1><?php 
echo $lang['common_projects'];
?>
</h1>

<?php 
$projectInst = new project();
if (!$loginInst->isCustomer()) {
    #######################################################################
    ## perform action
    $status = 1;
    if (tool::securePost('action') == "save" && tool::securePost('id')) {
        # fill project with submitted data
        $projectInst->id = tool::securePost('id');
        $projectInst->fill(tool::securePostAll());
        $status = $projectInst->update();
    } elseif (tool::securePost('action') == "save") {
        $projectInst->fill(tool::securePostAll());
        $status = $projectInst->insert();
    }
    if (tool::securePost('action') == "delete") {
        $projectInst->id = tool::securePost('id');
        $projectInst->delete();
    }
    if (tool::securePost('action') == "edit") {
        $status = 0;
        $projectInst->activate(tool::securePost('id'));
    }
    #######################################################################
    ## make edit / new form
开发者ID:pmtool,项目名称:pmtool,代码行数:30,代码来源:projects.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':
开发者ID:BackupTheBerlios,项目名称:bitts-svn,代码行数:31,代码来源:administration_projects.php

示例3: 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

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