Exemple #1
0
function edit($act_as_admin)
{
    global $del_x, $cancel, $sess, $ok_edit;
    if (isset($ok_edit)) {
        proceed($act_as_admin);
    } elseif (isset($cancel)) {
        cancel();
    } else {
        del($act_as_admin);
    }
    /*$sess->unregister("mytrail");
    $sess->unregister("action"); 
    $sess->unregister("thislink"); */
}
Exemple #2
0
function doit()
{
    global $sess, $kat, $mytrail, $create, $txt_title, $txt_description, $ok, $cancel, $HTTP_POST_VARS;
    if (isset($cancel)) {
        cancel();
        exit;
    } elseif (isset($kat)) {
        create($kat, $txt_title, $txt_description);
        exit;
    } elseif (isset($ok)) {
        edit($mytrail, $txt_description, $txt_title, false, isset($HTTP_POST_VARS['field_admin_do']));
        exit;
    } elseif ($HTTP_POST_VARS['ok'] == "" and $HTTP_POST_VARS['cancel'] == "" and $HTTP_POST_VARS['create'] == "") {
        del($mytrail['id'], isset($HTTP_POST_VARS['field_admin_do']));
        exit;
    }
}
* @subpackage Content
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_VALID_MOS') or die('Restricted access');
require_once $mainframe->getPath('admin_html');
$cid = josGetArrayInts('cid');
switch ($task) {
    case 'cancel':
        cancel($option);
        break;
    case 'new':
        edit(0, $option);
        break;
    case 'edit':
        edit($id, $option);
        break;
    case 'editA':
        edit(intval($cid[0]), $option);
        break;
    case 'go2menu':
    case 'go2menuitem':
    case 'resethits':
    case 'menulink':
    case 'save':
#
#
#
#
#
#
#
#
#
require "settings.php";
require "core-settings.php";
if (isset($_REQUEST["button"])) {
    list($button) = array_keys($_REQUEST["button"]);
    switch ($button) {
        case "cancelsel":
            $OUTPUT = cancel();
            break;
        case "allsel":
            $OUTPUT = printInv();
            break;
    }
} elseif (isset($_REQUEST["key"])) {
    switch ($_REQUEST["key"]) {
        case "view":
            $OUTPUT = printInv();
            break;
        case "delete_confirm":
            $OUTPUT = delete_confirm();
            break;
        case "delete_write":
            $OUTPUT = delete_write();
}
function cancel()
{
    echo "Couldn't apply settings: " . mysql_error();
    mysql_query("rollback");
    die;
}
mysql_query("begin");
if (!mysql_query($sql)) {
    cancel();
}
if ($user && !mysql_query("update `activeSemester` set `enrollment` = '{$reg}', `section` = '{$newsect}' where `member` = '{$newemail}' and `semester` = '{$SEMESTER}' and `choir` = '{$choir}'")) {
    cancel();
}
if (!$user && !mysql_query("insert into `activeSemester` (`member`, `semester`, `choir`, `enrollment`, `section`) values ('{$newemail}', '{$SEMESTER}', '{$choir}', '{$reg}', '{$newsect}')")) {
    cancel();
}
mysql_query("commit");
if (!$user || $newsect != $oldsect) {
    $msg = updateSection($newemail, $SEMESTER, $choir, $newsect, $user);
    if ($msg != "") {
        die("Couldn't set section: " . $msg);
    }
}
if (!$user || $user == $email) {
    setcookie("email", base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sessionkey, $newemail, MCRYPT_MODE_ECB)), time() + 60 * 60 * 24 * 120, "/", false, false);
}
if (!$user) {
    setcookie('choir', base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sessionkey, $choir, MCRYPT_MODE_ECB)), time() + 60 * 60 * 24 * 120, '/', false, false);
}
echo "OK";
Exemple #6
0
  {
  $phpmailer->IsHTML(true);
  if($email["content_nonhtml"] != "")
  $phpmailer->AltBody = $email["content_nonhtml"];
  }
 
  $email_send_result = @$phpmailer->Send();
  }
 */
 if (!$email_send_result) {
     echo "Error while sending email: " . $mail->ErrorInfo . ", ";
     if ($email["error_count"] == SENDING_RETRY_MAX_ATTEMPTS - 1) {
         update_error_count($email["id"], $email["error_count"] + 1);
         $incidence_text = "Error while sending email: [" . $mail->ErrorInfo . "] Cancelled: No more sending attempts allowed";
         add_incidence($email["id"], $incidence_text);
         cancel($email["id"]);
         $logger->add_log_incidence(array($email["id"], $email["to"], "Email cancelled", "No more sending attempts allowed"));
         echo "No more attempts allowed, cancelled";
     } else {
         update_error_count($email["id"], $email["error_count"] + 1);
         $incidence_text = "Error while sending email: [" . $mail->ErrorInfo . "] Scheduled for one more try";
         add_incidence($email["id"], $incidence_text);
         $logger->add_log_incidence(array($email["id"], $email["to"], "Email rescheduled", $incidence_text));
         echo "Scheduled for one more try";
     }
 } else {
     mark_as_sent($email["id"]);
     update_send_count($email["id"], $email["send_count"] + 1);
     update_sentdate($email["id"], $now);
     $logger->add_log_delivery(array($email["id"], "Email delivered", $email["from"], $email["to"], $email["subject"]));
     echo "Email delivered";
    $result = $client->documents->upload($name, $options);
    return $result->document->key;
}
/**
 * Resend a document
 */
function resend($key)
{
    global $client;
    $email = "*****@*****.**";
    $message = "Rapotchus";
    return $client->documents->resend($key, $email, $message);
}
/**
 * Cancel a document
 */
function cancel($key)
{
    global $client;
    return $client->documents->cancel($key);
}
$client = setup();
all();
$key = "sample_uuid";
find($key);
try {
    cancel($key);
} catch (Clicksign\ClicksignException $e) {
    var_dump($e);
}
find($key);
Exemple #8
0
/**
 * Create an artificial timeout for any Promise instance
 *
 * If the timeout expires prior to promise resolution the returned
 * promise is failed.
 *
 * @param \Amp\Promise $promise The promise to which the timeout applies
 * @param int $msTimeout The timeout in milliseconds
 * @return \Amp\Promise
 */
function timeout(Promise $promise, $msTimeout)
{
    $resolved = false;
    $promisor = new Deferred();
    $watcherId = once(function () use($promisor, &$resolved) {
        $resolved = true;
        $promisor->fail(new TimeoutException("Promise resolution timed out"));
    }, $msTimeout);
    $promise->when(function ($error = null, $result = null) use($promisor, $watcherId, &$resolved) {
        if ($resolved) {
            return;
        }
        $resolved = true;
        cancel($watcherId);
        if ($error) {
            $promisor->fail($error);
        } else {
            $promisor->succeed($result);
        }
    });
    return $promisor->promise();
}
<?php

include 'connect.php';
//insert code to database
//source: http://labs.jonsuh.com/jquery-ajax-php-json/
if (is_ajax()) {
    //Checks if action value exists
    if (isset($_POST["resID"])) {
        $id = $_POST["resID"];
        cancel($id);
        is_OK();
    } else {
        not_OK();
    }
} else {
    not_OK();
}
//Function to check if the request is an AJAX request
function is_ajax()
{
    return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
}
function is_OK()
{
    $return["status"] = "200";
    echo json_encode($return);
}
function not_OK()
{
    $return["status"] = "500";
    echo json_encode($return);
/**
 * Update company.
 * @author KikApp
 * @version 1.0
 */
$win = new SDPanel();
$id = new InputNumeric();
Data::getParm($id);
//Action bar and buttons bar
$acb = new ActionBar();
$btn_update = new ButtonBar();
$btn_update->setCaption("Save");
$btn_update->onTap(save());
$btn_cancel = new ButtonBar();
$btn_cancel->setCaption("Cancel");
$btn_cancel->onTap(cancel());
$acb->addControl($btn_update);
$acb->addControl($btn_cancel);
$win->addControl($acb);
$mainTable = new Table();
$image = new InputImage();
$name = new InputText();
$address = new InputAddress();
$phone = new InputPhone();
$mainTable->addControl($name, 1, 1);
$mainTable->addControl($address, 2, 1);
$mainTable->addControl($phone, 3, 1);
$mainTable->addControl($image, 4, 1);
$win->addControl($mainTable);
function start()
{
Exemple #11
0
<?php

require_once "./connect.php";
$id = "";
if (isset($_POST["id"])) {
    $id = $_POST["id"];
}
echo cancel($link, $id);
function cancel($link, $id)
{
    $query = "SELECT status FROM tickets WHERE id_ticket='{$id}'";
    if (!($result = mysqli_query($link, $query))) {
        return "false";
    }
    $row = mysqli_fetch_assoc($result);
    if ($row["status"] == 2) {
        return "false";
    } else {
        if ($row["status"] == 1) {
            $query = "UPDATE passengers SET count_trip=count_trip-1\n          WHERE passengers.id_pass=(SELECT id_pass FROM tickets WHERE id_ticket='{$id}');";
            if (!($result = mysqli_query($link, $query))) {
                return "false";
            }
        }
        $query = "UPDATE trip, tickets SET freeplace=freeplace+1, status='2', place='-1'\n                    WHERE tickets.id_ticket='{$id}' AND trip.id_trip=tickets.id_trip";
        if (!($result = mysqli_query($link, $query))) {
            return "false";
        }
    }
    return true;
}
Exemple #12
0
<?php

include "essential.php";
dbconnect();
print_r($_POST);
$query = "UPDATE Requests SET appStatus = 'Cancelled', reqRejectReason='" . $_POST['cancelReason'] . "' WHERE reqNo = " . $_POST['reqNo'] . ";";
execute($query);
$query = "DELETE FROM Instances WHERE reqNo = " . $_POST['reqNo'] . ";";
execute($query);
$query = "SELECT creator, creatorEmail, room from Requests WHERE reqNo =  " . $_POST['reqNo'] . ";";
$result = mysql_fetch_assoc(execute($query));
$query = "SELECT email from ccPerson WHERE reqNo =  " . $_POST['reqNo'] . ";";
$cc = array();
$result2 = execute($query);
while ($res = mysql_fetch_assoc($result2)) {
    $cc[] = $res['email'];
}
$cc = arrayToCSV($cc);
cancel($result['creator'], $result['creatorEmail'], $result['room'], $_POST['reqNo'], $_POST['cancelReason'], $cc);
header("Location: table.php?view=Accepted");
Exemple #13
0
function calculator($s)
{
    global $func;
    $z = $s;
    $count = 0;
    $flist = implode('|', $func);
    while (!ereg('^<[^>]*>$', $s)) {
        if (ereg('\\[<[^>]*>\\]', $s)) {
            #gauss(floor);
            $s = preg_replace('/\\[(<[^>]*>)\\]/e', 'cac_func("floor","\\1")', $s);
            continue;
        }
        if (ereg('\\[<[^>]*>(,<[^>]*>)+\\]', $s)) {
            #lcm;
            $s = preg_replace('/\\[(<[^>]*>(,<[^>]*>)+)\\]/e', 'cac_func("lcm","\\1")', $s);
            continue;
        }
        if (ereg('\\{<[^>]*>\\}', $s)) {
            #abs;
            $s = preg_replace('/\\{(<[^>]*>)\\}/e', 'cac_func("abs","\\1")', $s);
            continue;
        }
        if (ereg('<[^>]*>!', $s)) {
            #factorial;
            $s = preg_replace('/(<[^>]*>)!/e', 'cac_func("fac","\\1")', $s);
            continue;
        }
        if (ereg('<[^>]*>\\^<[^>]*>', $s)) {
            #pow;
            $s = preg_replace('/(<[^>]*>)\\^(<[^>]*>)/e', 'cac_func("pow","\\1,\\2")', $s);
            continue;
        }
        if (ereg('<[^>]*>\\*<[^>]*>', $s)) {
            #multiply;
            $s = preg_replace('/(<[^>]*>)\\*(<[^>]*>)/e', 'cac_func("multiply","\\1,\\2")', $s);
            continue;
        }
        if (ereg('<[^>]*>/<[^>]*>', $s)) {
            #divide;
            $s = preg_replace('/(<[^>]*>)\\/(<[^>]*>)/e', 'cac_func("divide","\\1,\\2")', $s);
            continue;
        }
        if (ereg('<[^>]*>%<[^>]*>', $s)) {
            #mod;
            $s = preg_replace('/(<[^>]*>)%(<[^>]*>)/e', 'cac_func("mod","\\1,\\2")', $s);
            continue;
        }
        if (ereg('<[^>]*>\\+<[^>]*>', $s)) {
            #plus;
            $s = preg_replace('/(<[^>]*>)\\+(<[^>]*>)/e', 'cac_func("plus","\\1,\\2")', $s);
            continue;
        }
        if (ereg('<[^>]*>-<[^>]*>', $s)) {
            #minus;
            $s = preg_replace('/(<[^>]*>)-(<[^>]*>)/e', 'cac_func("minus","\\1,\\2")', $s);
            continue;
        }
        if (preg_match('/(' . $flist . ')\\((<[^>]*>(,<[^>]*>)*)\\)/', $s)) {
            #func;
            for ($i = 0; $i < count($func); ++$i) {
                $s = preg_replace('/' . $func[$i] . '\\((<[^>]*>(,<[^>]*>)*)\\)/e', 'cac_func("' . $func[$i] . '","\\1")', $s);
            }
            continue;
        }
        if (ereg('\\(<[^>]*>(,<[^>]*>)+\\)', $s)) {
            #gcd;
            $s = preg_replace('/\\((<[^>]*>(,<[^>]*>)+)\\)/e', 'cac_func("gcd","\\1")', $s);
            continue;
        }
        $s = preg_replace('/\\((<[^>]*>)\\)/', '\\1', $s);
        if (cancel()) {
            return '<0>';
        }
        if ($s == $z) {
            ++$count;
        } else {
            $z = $s;
            $count = 0;
        }
        if ($count > 3) {
            break;
        }
    }
    return $s;
}