Example #1
0
 public static function DeleteProduct($id)
 {
     return parent::Delete('products', 'id', $id);
 }
Example #2
0
 /**
  * PDO::Delete
  * @return Delete
  */
 public static function pdoDelete()
 {
     return self::$Delete ? self::$Delete : (self::$Delete = new Delete());
 }
Example #3
0
 public static function DeleteCategory($id)
 {
     return parent::Delete('category', 'id', $id);
 }
Example #4
0
 public static function DeleteFeedback($id)
 {
     return parent::Delete('feedback', 'id', $id);
 }
Example #5
0
 public function Delete($ActivityID)
 {
     // Get the activity first
     $Activity = $this->GetID($ActivityID);
     if (is_object($Activity)) {
         $Users = array();
         $Users[] = $Activity->ActivityUserID;
         if (is_numeric($Activity->RegardingUserID) && $Activity->RegardingUserID > 0) {
             $Users[] = $Activity->RegardingUserID;
         }
         // Update the user's dateupdated field so that profile pages will not
         // be cached and will reflect this deletion.
         $this->SQL->Update('User')->Set('DateUpdated', Format::ToDateTime())->WhereIn('UserID', $Users)->Put();
         // Delete comments on the activity item
         parent::Delete(array('CommentActivityID' => $ActivityID), FALSE, TRUE);
         // Delete the activity item
         parent::Delete(array('ActivityID' => $ActivityID));
     }
 }
Example #6
0
 public static function DeleteOrder($id)
 {
     return parent::Delete('orders', 'id', $id);
 }
Example #7
0
} else {
    $Model = new Model(NULL, $lang->g('NavigationNewModel'));
}
if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'ModelView') {
    $Model->setFirstName(Utils::NullIfEmpty($_POST['txtFirstName']));
    $Model->setLastName(Utils::NullIfEmpty($_POST['txtLastName']));
    if ($_POST['txtBirthDate'] && $_POST['txtBirthDate'] != 'YYYY-MM-DD' && strtotime($_POST['txtBirthDate']) !== FALSE) {
        $Model->setBirthDate(strtotime($_POST['txtBirthDate']));
    } else {
        $Model->setBirthDate(-1);
    }
    $tags = Tag::GetTagArray($_POST['txtTags']);
    $Model->setRemarks(Utils::NullIfEmpty($_POST['txtRemarks']));
    if ($Model->getID()) {
        if ($DeleteModel) {
            if ($CurrentUser->hasPermission(RIGHT_MODEL_DELETE) && Model::Delete($Model, $CurrentUser)) {
                header('location:index.php');
                exit;
            }
        } else {
            if ($CurrentUser->hasPermission(RIGHT_MODEL_EDIT) && Model::Update($Model, $CurrentUser)) {
                Tag2All::HandleTags($tags, $TagsThisModel, $TagsInDB, $CurrentUser, $Model->getID(), NULL, NULL, NULL);
                header('location:index.php');
                exit;
            }
        }
    } else {
        if ($CurrentUser->hasPermission(RIGHT_MODEL_ADD) && Model::Insert($Model, $CurrentUser)) {
            Tag2All::HandleTags($tags, $TagsThisModel, $TagsInDB, $CurrentUser, $Model->getID(), NULL, NULL, NULL);
            header('location:index.php');
            exit;