Exemple #1
0
function miscapps_delete($miscapps_id)
{
    global $db;
    $sql = "DELETE FROM miscapps WHERE miscapps_id = " . $db->escapeSimple($miscapps_id);
    $result = $db->query($sql);
    if (DB::IsError($result)) {
        die_freepbx($result->getMessage() . $sql);
    }
    $fc = new featurecode('miscapps', 'miscapp_' . $miscapps_id);
    $fc->delete();
}
Exemple #2
0
<?php

// Delete the old code if still there
//
$fcc = new featurecode('daynight', 'toggle-mode');
$fcc->delete();
unset($fcc);
$list = daynight_list();
foreach ($list as $item) {
    $id = $item['ext'];
    $fcc = new featurecode('daynight', 'toggle-mode-' . $id);
    $fcc->delete();
    unset($fcc);
}
sql('DROP TABLE IF EXISTS daynight');
Exemple #3
0
function recordings_del($id)
{
    $results = sql("DELETE FROM recordings WHERE id = \"{$id}\"");
    // delete the feature code if it existed
    $fcc = new featurecode('recordings', 'edit-recording-' . $id);
    $fcc->delete();
    unset($fcc);
}
 /**
  * Update Recording by ID
  * @param integer $id          The recording ID
  * @param string  $name        The recording short name
  * @param string  $description The recording long name
  * @param string  $files       & separated list of files to playback
  * @param integer $fcode       Feature Code number_format
  * @param string  $fcode_pass  Feature code password
  */
 public function updateRecording($id, $name, $description, $files, $fcode = 0, $fcode_pass = '')
 {
     $sql = "UPDATE recordings SET displayname = ?, description = ?, filename = ?, fcode = ?, fcode_pass = ? WHERE id = ?";
     $sth = $this->db->prepare($sql);
     $sth->execute(array($name, $description, $files, $fcode, $fcode_pass, $id));
     if ($fcode != 1) {
         // delete the feature code if it existed
         //
         $fcc = new \featurecode('recordings', 'edit-recording-' . $id);
         $fcc->delete();
         unset($fcc);
     } else {
         // Add the feature code if it is needed
         //
         $fcc = new \featurecode('recordings', 'edit-recording-' . $id);
         $fcc->setDescription("Edit Recording: {$name}");
         $fcc->setDefault('*29' . $id);
         $fcc->setProvideDest();
         $fcc->update();
         unset($fcc);
     }
     needreload();
 }
 public function delete($miscapps_id)
 {
     $db = $this->db;
     $sql = "DELETE FROM miscapps WHERE miscapps_id = ?";
     $q = $db->prepare($sql);
     $q->execute(array($miscapps_id));
     if ($q) {
         debug('******* q was true **********');
         $fc = new \featurecode('miscapps', 'miscapp_' . $miscapps_id);
         $fc->delete();
         return true;
     }
     return false;
 }
 public function delTimeCondition($id)
 {
     $sql = "DELETE FROM timeconditions WHERE timeconditions_id = :id";
     $stmt = $this->db->prepare($sql);
     $fcc = new \featurecode('timeconditions', 'toggle-mode-' . $id);
     $fcc->delete();
     unset($fcc);
     if ($this->astman != null) {
         $this->astman->database_del("TC", $id);
     }
     \FreePBX::Hooks()->processHooks($id);
     return $stmt->execute(array(':id' => $id));
 }
function daynight_del($id)
{
    // TODO: delete ASTDB entry when deleting the mode
    //
    $results = sql("DELETE FROM daynight WHERE ext = {$id}", "query");
    $fcc = new featurecode('daynight', 'toggle-mode-' . $id);
    $fcc->delete();
    unset($fcc);
    $dn = new dayNightObject($id);
    $dn->del();
    unset($dn);
}