예제 #1
0
 public function add()
 {
     if ($this->isPost()) {
         $data = getRequestData('type,content');
         $aTag = $this->model->get($data);
         if (!empty($aTag)) {
             $set = array('usecount' => $aTag['usecount'] + 1);
             $this->model->where(array('id' => $aTag['id']))->data($set)->save();
             die('1');
         }
         $data['usecount'] = 1;
         if ($this->model->addData($data)) {
             echo '1';
         } else {
             echo $this->model->getError();
         }
     } else {
         $this->error('非法操作!');
     }
 }
예제 #2
0
<?php

include '../../settings.php';
include '../../inc/login_functions.php';
include '../../inc/helper.php';
include 'functions.php';
$logedIn = access($mysqli);
if (isset($_GET['request'])) {
    $request = trim(htmlentities($_GET['request'], ENT_QUOTES, "UTF-8"));
    $request = $mysqli->real_escape_string($request);
    $result = updateRequest($mysqli, $request, $_SESSION['userId']);
    $requestData = getRequestData($mysqli, $request, $_SESSION['userId']);
}
/* direkt zum thank You direkten */
if ($result === 1) {
    header("Location: ../Request/thankYou.php");
    exit;
}
$placeholder = "Hi advilist, \nich bin auf der Suche nach einem neuen Multimedia Notebook. Ich würde gerne Blu Rays darauf schauen und das Notebook an meinen Fernseher anschließen können. Außerdem wäre es super, wenn neue PC-Spiele darauf laufen würden... \n\nViele Grüße Martin";
include "../../inc/head.php";
?>

<section id="Content" role="main">
      <div class="container">

          <!-- SECTION EMPHASIS 1 -->
          <!-- FULL WIDTH -->
      </div><!-- !container -->
      <div class="full-width section-emphasis-1 page-header">
          <div class="container">
              <header class="row">
예제 #3
0
파일: Save.php 프로젝트: mslokhat/corebos
    $adb->pquery($del_sql, array($record));
    $record = $focus->id;
    foreach ($storearray as $id) {
        if ($id != '') {
            $sql = "insert into vtiger_cntactivityrel values (?,?)";
            $adb->pquery($sql, array($id, $record));
            if (!empty($heldevent_id)) {
                $sql = "insert into vtiger_cntactivityrel values (?,?)";
                $adb->pquery($sql, array($id, $heldevent_id));
            }
        }
    }
}
//code added to send mail to the vtiger_invitees
if (isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid'] != '') {
    $mail_contents = getRequestData($return_id);
    sendInvitation($_REQUEST['inviteesid'], $_REQUEST['activity_mode'], $_REQUEST['subject'], $mail_contents);
}
//to delete contact account relation while editing event
if (isset($_REQUEST['deletecntlist']) && $_REQUEST['deletecntlist'] != '' && $_REQUEST['mode'] == 'edit') {
    //split the string and store it in an array
    $storearray = explode(";", $_REQUEST['deletecntlist']);
    foreach ($storearray as $id) {
        if ($id != '') {
            $record = $focus->id;
            $sql = "delete from vtiger_cntactivityrel where contactid=? and activityid=?";
            $adb->pquery($sql, array($id, $record));
        }
    }
}
//to delete activity and its parent table relation
예제 #4
0
$filename = "data.sqlite3";
$conn = new PDO("sqlite:{$filename}", null, null, array(PDO::ATTR_PERSISTENT => true));
function getRequestData($key)
{
    if (isset($_POST[$key])) {
        return $_POST[$key];
    } else {
        if (isset($_GET[$key])) {
            return $_GET[$key];
        }
    }
    return null;
}
$action = getRequestData('action');
$id = getRequestData('id');
$value = getRequestData('value');
$db = new dbHelper($conn, $table);
$db->checkTableExists();
if ($action === 'get') {
    if ($id) {
        echo json_encode($db->getItemById($id));
    } else {
        echo json_encode(array("error" => "id is required"));
    }
} else {
    if ($action === 'set') {
        if ($value) {
            $db->insertItem($value);
            echo json_encode($db->getLastItem('ID'));
        } else {
            echo json_encode(array("error" => "value is required"));
예제 #5
0
 public function getFormData($oldData = array())
 {
     $this->error = '';
     //清空错误信息
     $data = getRequestData($this->getFormFields());
     foreach ($this->formConfig as $field => $aValue) {
         switch ($aValue[1]) {
             case 'checkbox':
                 $data[$field] = join(',', $data[$field]);
                 break;
             case 'file':
                 $aConfig = isset($aValue[3]['thumbs']) ? array('thumbs' => $aValue[3]['thumbs']) : array();
                 $fileType = isset($aValue[3]['type']) ? $aValue[3]['type'] : 'image';
                 $info = $this->_upload($field, $aConfig, $fileType);
                 if ($info['status'] == 0) {
                     $data[$field] = $info['data']['fileid'];
                     if ($oldData[$field]) {
                         //删除旧图
                         D('File')->del(array('id' => $oldData[$field]));
                     }
                 } elseif ($info['status'] == -1) {
                     //未上传时使用原来的值
                     $data[$field] = empty($oldData) ? 0 : $oldData[$field];
                 } else {
                     $this->error = $info['msg'];
                     $data[$field] = 0;
                 }
                 break;
             case 'password':
                 $data[$field] = md5($data[$field]);
                 break;
             default:
                 break;
         }
         if (is_array($aValue[2]) && in_array('once', $aValue[2]) && $oldData[$field]) {
             $data[$field] = $oldData[$field];
         }
     }
     return $data;
 }
 protected function send_to_conekta()
 {
     global $woocommerce;
     include_once 'conekta_gateway_helper.php';
     Conekta::setApiKey($this->secret_key);
     Conekta::setLocale("es");
     $data = getRequestData($this->order);
     $line_items = array();
     $items = $this->order->get_items();
     $line_items = build_line_items($items);
     $details = build_details($data, $line_items);
     try {
         $charge = Conekta_Charge::create(array("amount" => $data['amount'], "currency" => $data['currency'], "reference_id" => $this->order->id, "description" => "Recibo de pago para orden # " . $this->order->id, "cash" => array("type" => "oxxo"), "details" => $details));
         $this->transactionId = $charge->id;
         update_post_meta($this->order->id, 'conekta-id', $charge->id);
         update_post_meta($this->order->id, 'conekta-creado', $charge->created_at);
         update_post_meta($this->order->id, 'conekta-expira', $charge->payment_method->expiry_date);
         update_post_meta($this->order->id, 'conekta-barcode', $charge->payment_method->barcode);
         update_post_meta($this->order->id, 'conekta-barcodeurl', $charge->payment_method->barcode_url);
         return true;
     } catch (Conekta_Error $e) {
         $description = $e->message_to_purchaser;
         global $wp_version;
         if (version_compare($wp_version, '4.1', '>=')) {
             wc_add_notice(__('Error: ', 'woothemes') . $description, $notice_type = 'error');
         } else {
             error_log('Gateway Error:' . $description . "\n");
             $woocommerce->add_error(__('Error: ', 'woothemes') . $description);
         }
         return false;
     }
 }
예제 #7
0
  </h1>
  <br>
  <span class="price"><?php 
echo "€ " . $offer['preis'];
?>
</span>
</header>

<a href="<?php 
echo $offer['affUrl'];
?>
" id="showArt" class="btn btn-primary">Zum Shop</a>

<?php 
if ($logedIn === true) {
    $requestData = getRequestData($mysqli, $offer['requestId'], $_SESSION['userId']);
    if ($offer['userId'] == $_SESSION['userId'] || $requestData['userId'] == $_SESSION['userId']) {
        /* Neue Nachrichten */
        $getNewMessages = $mysqli->query("SELECT * FROM messages WHERE offerId = '" . $offer['id'] . "' AND empfaengerId = '" . $_SESSION['userId'] . "' AND gesehen = '1' ");
        if ($getNewMessages->num_rows != 0) {
            echo '<button type="button" id="showOffChat" class="btn btn-default"><span id="newMessages">Neue</span> Nachrichten</button>';
        } else {
            echo '<button type="button" id="showOffChat" class="btn btn-default">Nachrichten</button>';
        }
        ?>
        
      <!-- ChatBox -->
      <div id="chatDialog" class="chatBox">
        <div class='showMessages' id="showMessages"></div>
        <form action="#" method="post" id="messageForm">
          <input type="text" name="message" class='message' id="message"><br>         
예제 #8
0
function requestData($requestData, $type = "")
{
    return setStringContent(getRequestData(AntiSqlInjek($requestData, $type)));
}
예제 #9
-1
 protected function send_to_conekta()
 {
     global $woocommerce;
     include_once 'conekta_gateway_helper.php';
     Conekta::setApiKey($this->secret_key);
     Conekta::setLocale("es");
     $data = getRequestData($this->order);
     try {
         $line_items = array();
         $items = $this->order->get_items();
         $line_items = build_line_items($items);
         $details = build_details($data, $line_items);
         $charge = Conekta_Charge::create(array("amount" => $data['amount'], "currency" => $data['currency'], "monthly_installments" => $data['monthly_installments'] > 1 ? $data['monthly_installments'] : null, "card" => $data['token'], "reference_id" => $this->order->id, "description" => "Compra con orden # " . $this->order->id . " desde Woocommerce v" . $this->version, "details" => $details));
         $this->transactionId = $charge->id;
         if ($data['monthly_installments'] > 1) {
             update_post_meta($this->order->id, 'meses-sin-intereses', $data['monthly_installments']);
         }
         update_post_meta($this->order->id, 'transaction_id', $this->transactionId);
         return true;
     } catch (Conekta_Error $e) {
         $description = $e->message_to_purchaser;
         global $wp_version;
         if (version_compare($wp_version, '4.1', '>=')) {
             wc_add_notice(__('Error: ', 'woothemes') . $description, $notice_type = 'error');
         } else {
             error_log('Gateway Error:' . $description . "\n");
             $woocommerce->add_error(__('Error: ', 'woothemes') . $description);
         }
         return false;
     }
 }