本文整理汇总了PHP中Evaluation::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::insert方法的具体用法?PHP Evaluation::insert怎么用?PHP Evaluation::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluation
的用法示例。
在下文中一共展示了Evaluation::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: evaluateAction
public function evaluateAction()
{
$username = $this->_getParam('username');
if (!empty($username)) {
$form = $this->_getEvaluationForm($username);
if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
$values = $form->getValues();
require_once APPLICATION_PATH . "/model/Evaluation.php";
$table = new Evaluation();
$date = new Zend_Date();
$data['date'] = $date->getIso();
$data['rating'] = $values['rating'];
$data['motivation'] = $values['motivation'];
$data['evaluator'] = Zend_Auth::getInstance()->getIdentity()->username;
$data['evaluated_user'] = $username;
$table->insert($data);
$this->_helper->redirector('profile', 'user', 'default', array('username' => $username, 'evaluationInserted' => true));
}
$this->view->form = $form;
}
}
示例2: Evaluation
if (isset($_POST['selectEval']) && !empty($_POST['selectEval']))
header('location: ../Intranet/affectNote.php?idEval='.$_POST['selectEval']);
}
if (isset($_POST['btAjouter'])) {
$evaluation = new Evaluation();
$evaluation->setDateEvaluation($_POST['addDate']);
$evaluation->setIdMatiereNiveau(MatiereNiveau::getByMatiereNiveau($_POST['addMatiere'], $_POST['addNiveau'])->getIdMatiereNiveau());
$evaluation->setIdTypeEvaluation($_POST['addType']);
$evaluation->setTitreEvaluation(db_connect::escape_string($_POST['addTitre']));
// echo $evaluation->getTitreEvaluation();
$evaluation->setMaxEvaluation($_POST['addMax']);
if ($evaluation->getIdTypeEvaluation() == 3)
$evaluation->setAutreEvaluation(db_connect::escape_string($_POST['autreEval']));
if ($evaluation->insert()){
$msgInsert = "<h4 style='color: green'>
L'ajout de l'évaluation a réussi.
</h4>";
}
else{
$msgInsert = "<h4 style='color: red'>
L'ajout de l'évaluation a échoué.
</h4>";
}
// tansfert du fichier Sujet associ�.
if (!empty($_FILES['fichierSujet'])) {
if (ftp_link::estPDFfile($_FILES['fichierSujet']['name'], $_FILES['fichierSujet']['type'])) {
if ($_FILES['fichierSujet']['error'] == 0)
if (!move_uploaded_file($_FILES['fichierSujet']['tmp_name'], '../Evaluation/Sujet' . $evaluation->getIdEvaluation() . '.pdf')) {