Example #1
0
 if (!empty($_POST)) {
     lovd_errorClean();
     // Mandatory fields.
     if (empty($_POST['password'])) {
         lovd_errorAdd('password', 'Please fill in the \'Enter your password for authorization\' field.');
     }
     // User had to enter his/her password for authorization.
     if ($_POST['password'] && !lovd_verifyPassword($_POST['password'], $_AUTH['password'])) {
         lovd_errorAdd('password', 'Please enter your correct password for authorization.');
     }
     if (!lovd_error()) {
         // Query text.
         // This also deletes the entries in variants.
         $_DATA->deleteEntry($nID);
         // Change updated date for gene.
         lovd_setUpdatedDate($zData['geneid']);
         // Write to log...
         lovd_writeLog('Event', LOG_EVENT, 'Deleted transcript information entry ' . $nID . ' - ' . $zData['geneid'] . ' (' . $zData['name'] . ')');
         // Thank the user...
         header('Refresh: 3; url=' . lovd_getInstallURL() . $_PE[0]);
         $_T->printHeader();
         $_T->printTitle();
         lovd_showInfoTable('Successfully deleted the transcript information entry!', 'success');
         $_T->printFooter();
         exit;
     } else {
         // Because we're sending the data back to the form, I need to unset the password fields!
         unset($_POST['password']);
     }
 }
 $_T->printHeader();
Example #2
0
         lovd_errorAdd('password', 'Please fill in the \'Enter your password for authorization\' field.');
     }
     // User had to enter his/her password for authorization.
     if ($_POST['password'] && !lovd_verifyPassword($_POST['password'], $_AUTH['password'])) {
         lovd_errorAdd('password', 'Please enter your correct password for authorization.');
     }
     if (!lovd_error()) {
         // Get genes which are modified before we delete the entry.
         // Only when phenotype, individual and variant are marked or public.
         if ($zData['statusid'] >= STATUS_MARKED) {
             $aGenes = $_DB->query('SELECT DISTINCT t.geneid FROM ' . TABLE_TRANSCRIPTS . ' AS t ' . 'INNER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (vot.transcriptid = t.id) ' . 'INNER JOIN ' . TABLE_VARIANTS . ' AS vog ON (vog.id = vot.id) ' . 'INNER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s2v.variantid = vog.id) ' . 'INNER JOIN ' . TABLE_SCREENINGS . ' AS s ON (s.id = s2v.screeningid) ' . 'INNER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (i.id = s.individualid) ' . 'INNER JOIN ' . TABLE_PHENOTYPES . ' AS p ON (p.individualid = i.id) ' . 'WHERE vog.statusid >= ? AND i.statusid >= ? AND p.id = ?', array(STATUS_MARKED, STATUS_MARKED, $nID))->fetchAllColumn();
         }
         $_DATA->deleteEntry($nID);
         if ($zData['statusid'] >= STATUS_MARKED && $aGenes) {
             // Change updated date for genes.
             lovd_setUpdatedDate($aGenes);
         }
         // Write to log...
         lovd_writeLog('Event', LOG_EVENT, 'Deleted phenotype information entry ' . $nID . ' (Owner: ' . $zData['owner'] . ')');
         // Thank the user...
         header('Refresh: 3; url=' . lovd_getInstallURL() . 'individuals/' . $zData['individualid']);
         $_T->printHeader();
         $_T->printTitle();
         lovd_showInfoTable('Successfully deleted the phenotype information entry!', 'success');
         $_T->printFooter();
         exit;
     } else {
         // Because we're sending the data back to the form, I need to unset the password fields!
         unset($_POST['password']);
     }
 }
Example #3
0
         }
         $_BAR->setProgress(100);
         $_BAR->setMessage('Done!');
         // All successful, now we can commit.
         $_DB->commit();
         $sMessage = '';
         if (count($aDone)) {
             foreach ($aDone as $sSection => $n) {
                 $sMessage .= (!$sMessage ? '' : ', ') . $n . ' ' . $sSection;
             }
             $sMessage = 'deleted ' . preg_replace('/, ([^,]+)/', " and \$1", $sMessage);
         } else {
             $sMessage = 'no data to delete';
         }
         lovd_writeLog('Event', LOG_EVENT, 'Emptied gene database ' . $sID . '; ' . $sMessage . '; ran ' . $nDone . ' queries.');
         lovd_setUpdatedDate($sID);
         // FIXME; regardless of variant status... oh, well...
         // Thank the user...
         lovd_showInfoTable('Successfully emptied the ' . $sID . ' gene database!', 'success');
         $_BAR->redirectTo(lovd_getInstallURL() . 'configuration', 3);
         $_T->printFooter();
         exit;
     } else {
         // Because we're sending the data back to the form, I need to unset the password fields!
         unset($_POST['password']);
     }
 }
 lovd_errorPrint();
 lovd_includeJS('inc-js-tooltip.php');
 // Table.
 print '      <FORM action="' . CURRENT_PATH . '?' . ACTION . '" method="post">' . "\n";