コード例 #1
0
ファイル: ajax_kyselyt.php プロジェクト: jpkerkkanen/opinnot
         echo '<linkit>';
         echo '<aukaisu>' . $aukaisu . '</aukaisu>';
         echo '<isannan_id>' . $id_kokon . '</isannan_id>';
         echo $linkit_xml;
         echo '</linkit>';
     } catch (Exception $poikkeus) {
         //echo "Virhe: ".$poikkeus->getMessage();
     }
 } else {
     if ($kysymys === "hae_elementit") {
         header('Content-type: text/xml');
         echo hae_elementit($parametriolio, $koostekontrolleri, $tietokantaolio, $koodaus);
     } else {
         if ($kysymys === "remove_element") {
             header('Content-type: text/xml');
             echo remove_element($parametriolio, $tietokantaolio, $koodaus);
         } else {
             if ($kysymys === "show_element_preview") {
                 echo show_element_preview($id_raaka, $parametriolio, $tehtavanakymat, $kokonaisuusnakymat);
             } else {
                 if ($kysymys === "muuta_kaavakieli") {
                     $muokattavan_elementin_id = isset($_REQUEST['muok_elem_id']) ? $_REQUEST['muok_elem_id'] : "piip";
                     $alasvetovalikon_id = isset($_REQUEST['alasvetoval_id']) ? $_REQUEST['alasvetoval_id'] : "piip";
                     $kaavakieli = $parametriolio->kaavakieli;
                     // Tekstinmuokkaus tiivistelmää varten:
                     $tekstityokaluolio = new Tekstityokalupalkki($muokattavan_elementin_id, $alasvetovalikon_id);
                     // Nykyään nämä toimii sekä tiivistelmälle että selitykselle.
                     // Lomake osaa huomata, kunpaa ollaan muokkaamassa:
                     $tekstimuokkauspainikkeet = $tekstityokaluolio->luo_painikkeet(Tekstityokalupalkki::$PERUSPAINIKKEET_JA_MATEMAATTISET, $kaavakieli);
                     echo $tekstimuokkauspainikkeet;
                 }
コード例 #2
0
ファイル: cron.php プロジェクト: Elwell/concerto
function hourly($screen_rotate = false)
{
    //Rotate any screens that need a template rotation every 6 hours
    if (date('H') % 6 == 0) {
        if (is_array($screen_rotate)) {
            echo "Executing template rotation.\n";
            foreach ($screen_rotate as $key => $templates) {
                $scr = new Screen($key);
                $templates = remove_element($templates, $scr->template_id);
                $new_key = array_rand($templates, 1);
                $scr->template_id = $templates[$new_key];
                $scr->set_properties();
            }
            echo "Template rotation complete.\n";
        }
        echo "Hourly job complete.\n";
    }
    //End template rotation
}
コード例 #3
0
ファイル: barcodes.php プロジェクト: onyxnz/quartzpos
require 'fb.php';
FB::log($_REQUEST, "barcodes php: starting REQUEST=");
require_once "config.php";
include_once "languages/" . POS_DEFAULT_LANGUAGE . ".php";
include_once 'helpers.php';
FB::log($_REQUEST, " barcode REQUEST vars=");
FB::log($_POST, " barcode post vars=");
require_once "database.php";
$msg = '';
if (isset($_REQUEST['prodcode'])) {
    $prodcode = $_REQUEST['prodcode'];
    if (isset($_POST['submit'])) {
        //FB::log($_POST, " barcode post vars=");
        //the form has submitted into itself
        $array = remove_element($_POST, "Submit");
        $array = remove_element($array, $prodcode);
        //FB::log($array, "barcodes array=");
        //$array only conatins valid barcodes
        $sql = "DELETE from barcodes WHERE prodcode = '{$prodcode}'";
        $results = $db->query($sql);
        //cleared all, now add back
        foreach ($array as $key => $val) {
            if (!empty($val)) {
                $val = $db->clean($val);
                // check to see if already assigned
                $sql = "SELECT * FROM barcodes WHERE barcode = '{$val}'";
                $results = $db->QPResults($sql);
                //FB::log($results, "find SELECT results");
                if (!isset($results['barcode'])) {
                    $sql = "INSERT INTO barcodes (barcode, prodcode) VALUES ('{$val}', '{$prodcode}')";
                    $results = $db->query($sql);