コード例 #1
0
ファイル: GlPah.php プロジェクト: saifulihsan/gkkd-jogja
 public function add_comments($type, $type_no, $date_, $memo_)
 {
     if ($memo_ != null && $memo_ != "") {
         $comment = new PahComments();
         $comment->type = $type;
         $comment->type_no = $type_no;
         $comment->date_ = $date_;
         $comment->memo_ = $memo_;
         if (!$comment->save()) {
             throw new Exception("Gagal menyimpan keterangan.");
         }
     }
 }
コード例 #2
0
ファイル: Pah.php プロジェクト: saifulihsan/gkkd-jogja
 static function delete_comments($type, $type_no)
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition("type=" . $type);
     $criteria->addCondition("id=" . $type_no);
     $comment = PahComments::model()->find($criteria);
     $comment->delete();
 }