コード例 #1
0
ファイル: viewmypdf08.php プロジェクト: kirkendall/shiftcal
$pdf->SetFont('Helvetica');
$pdf->SetFontSize($_REQUEST["micro"] == "" ? 8 : 6);
if ($_REQUEST["image"] == "") {
    $firstpage = 1;
} else {
    $pdf->add_image("images/pp08logo.jpg", 1);
    $firstpage = 2;
}
# Fetch a list of all events, including the ones we won't print
$sql = "SELECT * FROM calevent, caldaily WHERE calevent.id = caldaily.id AND eventdate >= '{$startdate}' AND eventdate <= '{$enddate}' AND eventstatus<>'E' AND eventstatus<>'S' AND eventstatus<>'C' ORDER BY eventdate, eventtime";
$result = mysql_query($sql, $conn) or die(mysql_error());
# for each event...
$thisdate = "";
while ($record = mysql_fetch_array($result)) {
    # If we care about this event...
    if (ischecked($record["eventdate"], $record["id"])) {
        # If the date is different, then output the date
        if ($thisdate != $record["eventdate"]) {
            if ($thisdate == "") {
                $thisdate = $record["eventdate"];
                $pdf->add_text(strtoupper(date("l F j", strtotime($thisdate))) . "  -------------------------", $firstpage);
            } else {
                $thisdate = $record["eventdate"];
                $pdf->add_text(strtoupper(date("l F j", strtotime($thisdate))) . "  -------------------------");
            }
        }
        # Output the title.  Try to get a "bold" effect by outputting it twice,
        # with the second copy offset slightly.
        $startpg = $pdf->_sect;
        $startx = $pdf->_lastx;
        $starty = $pdf->_lasty;
コード例 #2
0
echo $id;
?>
">
                        </div>
                    </div>
                    
                    <div class="mws-form-row">
                        <label>Is Show</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="is_display" value="1" <?php 
echo ischecked($data['is_display'], 1);
?>
/ > <label>Yes</label></li>
                                <li><input type="radio" name="is_display" value="0" <?php 
echo ischecked($data['is_display'], 0);
?>
/> <label>No</label></li>
                            </ul>
                        </div>
                    </div>

                    <div class="mws-button-row">
                        <input type="submit" value="Modify" class="mws-button red" />
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
コード例 #3
0
echo ischecked($data['sex'], 2);
?>
 /> <label>Protected</label></li>
                            </ul>
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label>User Level</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name="level" value="1" <?php 
echo ischecked($data['level'], 1);
?>
/> <label>Manager</label></li>
                                <li><input type="radio" name="level" value="3" <?php 
echo ischecked($data['level'], 3);
?>
/> <label>common Member</label></li>
                            </ul>
                        </div>
                    </div>
                 
                    
                    <div class="mws-button-row">
                        <input type="submit" value="Modify" class="mws-button red" />
                    </div>
                </div>             
            </form>
        </div>
    </div>
</div>
コード例 #4
0
function cart_product_list_string($licensecolumn)
{
    // the function is for displaying the list of products
    // if $licensecolumn is False we don't diplay extra columns
    global $wpdb, $result_no_license_text;
    $siteurl = get_option('siteurl');
    $current_item = 0;
    $total = 0;
    $cart = isset($_SESSION['nzshpcrt_cart']) ? $_SESSION['nzshpcrt_cart'] : "";
    $result = '<table class=\'productcart\'>';
    $result_no_license_text = '<table class=\'productcart\'>';
    if (isset($cart) && $cart != '') {
        foreach ($cart as $key => $cart_item) {
            $current_item = $current_item + 1;
            $product_id = $cart_item->product_id;
            $quantity = $cart_item->quantity;
            $number =& $quantity;
            $product_variations = $cart_item->product_variations;
            $variation_count = count($product_variations);
            if ($variation_count >= 1) {
                $variation_list = "&nbsp;(";
                $i = 0;
                foreach ($product_variations as $value_id) {
                    if ($i > 0) {
                        $variation_list .= ",&nbsp;";
                    }
                    $value_data = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "variation_values` WHERE `id`='" . $value_id . "' LIMIT 1", ARRAY_A);
                    $variation_list .= str_replace(" ", "&nbsp;", stripslashes($value_data[0]['name']));
                    $i++;
                }
                $variation_list .= ")";
            } else {
                $variation_list = '';
            }
            $sql = "SELECT `wp_product_list`.*, `wp_product_files`.`width`, `wp_product_files`.`height`, `wp_product_brands`.`name` as brand, `wp_product_categories`.`name` as kategoria FROM `wp_product_list`, `wp_product_files`, `wp_product_brands`, `wp_product_categories` WHERE wp_product_list.id='{$product_id}' AND `wp_product_list`.`active`='1' AND `wp_product_list`.`visible`='1' AND `wp_product_list`.`file` = `wp_product_files`.`id` AND `wp_product_brands`.`id` = `wp_product_list`.`brand` AND `wp_product_list`.`category` = `wp_product_categories`.`id`  ORDER BY `wp_product_list`.`id` DESC LIMIT 1";
            $product_list = $wpdb->get_results($sql, ARRAY_A);
            if (!$licensecolumn) {
                // download link start
                $link = "";
                $previous_download_ids = array(0);
                $sessionid = $_GET['sessionid'];
                $selectsql = "SELECT * FROM `wp_purchase_logs` WHERE `sessionid`= " . $sessionid . " LIMIT 1";
                $check = $wpdb->get_results($selectsql, ARRAY_A);
                //pokazh($product_list,"product_list");
                if (isset($product_list[0]['file']) && isset($check[0]['id']) && $product_list[0]['file'] > 0) {
                    $wpdb->query("UPDATE `wp_download_status` SET `active`='1' WHERE `fileid`='" . $product_list[0]['file'] . "' AND `purchid` = '" . $check[0]['id'] . "' LIMIT 1");
                    $download_data = $wpdb->get_results("SELECT * FROM `wp_download_status` WHERE `fileid`='" . $product_list[0]['file'] . "' AND `purchid`='" . $check[0]['id'] . "' AND `id` NOT IN (" . make_csv($previous_download_ids) . ") LIMIT 1", ARRAY_A);
                    $download_data = $download_data[0];
                    /* 
                     * for security reason add to url for hires images sid - last 6 simbols of idhash
                     *
                     */
                    $sql = "SELECT `idhash` FROM `wp_product_files` WHERE `id`=" . $product_list[0]['file'] . " LIMIT 1";
                    $idhash_data = $wpdb->get_results($sql, ARRAY_A);
                    if ($idhash_data != null) {
                        $idhash = "&sid=" . substr($idhash_data[0]['idhash'], -6);
                    }
                    $site_tmp = includeTrailingCharacter($siteurl, "/");
                    $link = $site_tmp . "?downloadid=" . $download_data['id'] . $idhash;
                    $previous_download_ids[] = $download_data['id'];
                }
                /// download link stop
            }
            $result .= "<tr>";
            $result .= "  <td style='width:144px;'>";
            $result_no_license_text .= "<tr>";
            $result_no_license_text .= "  <td style='width:144px;'>";
            $basepath = get_option('siteurl');
            $imagedir = $basepath . "/wp-content/plugins/wp-shopping-cart/images/";
            $previewdir = $basepath . "/wp-content/plugins/wp-shopping-cart/product_images/";
            $result .= "<a href='" . $previewdir . $product_list[0]['image'] . "'><img border='0' src='" . $imagedir . $product_list[0]['image'] . "'></a>";
            $result .= "  </td>";
            $result .= "  <td>";
            $result_no_license_text .= "<a href='" . $previewdir . $product_list[0]['image'] . "'><img border='0' src='" . $imagedir . $product_list[0]['image'] . "'></a>";
            $result_no_license_text .= "  </td>";
            $result_no_license_text .= "  <td>";
            $_size = $product_list[0]['width'] . "px X " . $product_list[0]['height'] . "px;";
            $_bigpictext = "<b>Номер:</b> " . $product_list[0]['id'];
            $_bigpictext .= "<br /><b>Автор:</b> " . $product_list[0]['brand'];
            $_bigpictext .= "<br /><b>Название: </b> " . nl2br(stripslashes($product_list[0]['name']));
            $_bigpictext .= "<br /><b>Категория: </b> " . $product_list[0]['kategoria'];
            $_bigpictext .= "<br /><b>Описание: </b> " . nl2br(stripslashes($product_list[0]['description']));
            $_bigpictext .= "<br /><b>Тэги: </b>" . nl2br(stripslashes($product_list[0]['additional_description']));
            $_bigpictext .= "<br /><b>Размер:</b> " . $_size;
            $_bigpictext .= "<br /><b>Цена (без скидки):</b> " . $_SESSION['nzshpcrt_cart'][$key]->price . " руб.";
            $_bigpictext .= "<br /><b>Лицензия:</b> " . license_name($_SESSION['nzshpcrt_cart'][$key]->license);
            $_SESSION['nzshpcrt_cart'][$key]->author = $product_list[0]['brand'];
            $result .= "<div style='font-size: 8pt !important;'>" . $_bigpictext . "</div>";
            $result .= "  </td>";
            $result_no_license_text .= "<div style='font-size: 8pt !important;'>" . $_bigpictext . "</div>";
            $result_no_license_text .= "  </td>";
            if ($licensecolumn) {
                $result .= "  <td width='240'>";
                $result .= "<form name='licenses' id='licenses' onsubmit='submitform(this);return false;' action='" . $siteurl . "/?page_id=29' method='POST'>";
                $result_no_license_text .= "  <td width='240'>";
                $result_no_license_text .= "<form name='licenses' id='licenses' onsubmit='submitform(this);return false;' action='" . $siteurl . "/?page_id=29' method='POST'>";
                $ch1 = ischecked('l1_price', $product_list[0]['id']);
                $result .= "<input name='license' value='l1_price' type='radio' {$ch1} />";
                $result .= round($product_list[0]['l1_price']) . "&nbsp;руб. ";
                $result .= "<a title='ваша лицензия' href='#' onclick=\"javascript:window.open('" . $siteurl . "/wp-content/plugins/wp-shopping-cart/license.php?l=1&item=" . $current_item . "','текст ограниченной лицензии','height=480,width=640,scrollbars=yes');\">ограниченная</a> <br />";
                $result_no_license_text .= "<input name='license' value='l1_price' type='radio' {$ch1} />";
                $result_no_license_text .= round($product_list[0]['l1_price']) . "&nbsp;руб. ";
                $result_no_license_text .= "<a title='ваша лицензия' href='#' onclick=\"javascript:window.open('" . $siteurl . "/wp-content/plugins/wp-shopping-cart/license.php?l=1&item=" . $current_item . "','текст ограниченной лицензии','height=480,width=640,scrollbars=yes');\">ограниченная</a> <br />";
                $ch2 = ischecked('l2_price', $product_list[0]['id']);
                $result .= "<input name='license' value='l2_price' type='radio' {$ch2} />";
                $result .= round($product_list[0]['l2_price']) . "&nbsp;руб. <a title='ваша лицензия' href='#' onclick=\"javascript:window.open('" . $siteurl . "/wp-content/plugins/wp-shopping-cart/license.php?l=2&item=" . $current_item . "','текст стандартной лицензии','height=480,width=640,scrollbars=yes');\">стандартная</a><br />";
                $result_no_license_text .= "<input name='license' value='l2_price' type='radio' {$ch2} />";
                $result_no_license_text .= round($product_list[0]['l2_price']) . "&nbsp;руб. <a title='ваша лицензия' href='#' onclick=\"javascript:window.open('" . $siteurl . "/wp-content/plugins/wp-shopping-cart/license.php?l=2&item=" . $current_item . "','текст стандартной лицензии','height=480,width=640,scrollbars=yes');\">стандартная</a><br />";
                $ch3 = ischecked('l3_price', $product_list[0]['id']);
                $result .= "<input name='license' value='l3_price' type='radio'  {$ch3} />";
                $result .= round($product_list[0]['l3_price']) . "&nbsp;руб. <a title='ваша лицензия' href='#' onclick=\"javascript:window.open('" . $siteurl . "/wp-content/plugins/wp-shopping-cart/license.php?l=3&item=" . $current_item . "','текст расширенной лицензии','height=480,width=640,scrollbars=yes');\">расширенная</a>";
                $result .= "<input value='" . $product_list[0]['id'] . "' name='prodid' type='hidden'> <br /><br />";
                $result .= "<input id='searchsubmit' value='Сменить лицензию' type='submit'> </form>";
                $result .= " </td>";
                $result_no_license_text .= "<input name='license' value='l3_price' type='radio'  {$ch3} />";
                $result_no_license_text .= round($product_list[0]['l3_price']) . "&nbsp;руб. <a title='ваша лицензия' href='#' onclick=\"javascript:window.open('" . $siteurl . "/wp-content/plugins/wp-shopping-cart/license.php?l=3&item=" . $current_item . "','текст расширенной лицензии','height=480,width=640,scrollbars=yes');\">расширенная</a>";
                $result_no_license_text .= "<input value='" . $product_list[0]['id'] . "' name='prodid' type='hidden'> <br /><br />";
                $result_no_license_text .= "<input id='searchsubmit' value='Сменить лицензию' type='submit'> </form>";
                $result_no_license_text .= " </td>";
            }
            if (isset($product_list[0]['price'])) {
                $total += $number * $product_list[0]['price'];
            }
            if ($licensecolumn) {
                // License select
                $result .= "  <td width='70'>";
                $result .= "<a href='" . get_option('shopping_cart_url') . "&remove=" . $key . "'>Убрать из заказа</a>";
                $result .= "  </td>";
            } else {
                // Download link
                $current_user = wp_get_current_user();
                $result .= "  <td width='140'>";
                $result_no_license_text .= "  <td width='140'>";
                if (isset($current_user) && $current_user->ID == '106') {
                    $result .= "<a href='" . get_option('siteurl') . "/demo/demo.jpg'  style='background-color:#33ff99;padding:7px;border:1px #a3a598 solid;text-decoration:none;margin-top:16px;'>Скачать demo</a>";
                    $result_no_license_text .= "<a href='" . get_option('siteurl') . "/demo/demo.jpg'  style='background-color:#33ff99;padding:7px;border:1px #a3a598 solid;text-decoration:none;margin-top:16px;'>Скачать demo</a>";
                } else {
                    $result .= "<a href='{$link}'  style='background-color:#33ff99;padding:7px;border:1px #a3a598 solid;text-decoration:none;margin-top:16px;'>Скачать</a>";
                    $result_no_license_text .= "<a href='{$link}'  style='background-color:#33ff99;padding:7px;border:1px #a3a598 solid;text-decoration:none;margin-top:16px;'>Скачать</a>";
                }
                $result .= "  </td>";
                $result_no_license_text .= "  </td>";
            }
            $result .= "</tr>";
            $result_no_license_text .= "</tr>";
            // License text
            if (!$licensecolumn) {
                if ($_SESSION['nzshpcrt_cart'][$current_item]->price == '250.00') {
                    $lic_type = 1;
                } elseif ($_SESSION['nzshpcrt_cart'][$current_item]->price == '500.00') {
                    $lic_type = 2;
                } elseif ($_SESSION['nzshpcrt_cart'][$current_item]->price == '2500.00') {
                    $lic_type = 3;
                } else {
                    $lic_type = 1;
                }
                $license_text = get_license($current_item, $lic_type);
                $result .= "<tr>";
                $result .= "<td colspan=3> <a id='displayText" . $current_item . "' href='javascript:toggle(" . $current_item . ");'>[+] показать текст лицензии</a><div id='toggleText" . $current_item . "' style='display:none;background-color:#FFFFCC;padding:8px;'><br />";
                $result .= $license_text;
                $result .= "</div></td>";
                $result .= "</tr>";
            }
        }
        // end of: foreach($cart as $key => $cart_item)
    } else {
        return '';
    }
    $result .= '</table>';
    $result_no_license_text .= '</table>';
    $result .= "<script language='javascript'> ";
    $result .= "function toggle(item) {";
    $result .= "var ele = document.getElementById('toggleText'+item);";
    $result .= "var text = document.getElementById('displayText'+item);";
    $result .= "if(ele.style.display == 'block') {";
    $result .= "\t\tele.style.display = 'none';";
    $result .= "\ttext.innerHTML = '[+] показать текст лицензии<br />';";
    $result .= "}";
    $result .= "else {";
    $result .= "\tele.style.display = 'block';";
    $result .= "\ttext.innerHTML = '[-] скрыть текст лицензии<br />';";
    $result .= "}";
    $result .= "} ";
    $result .= "</script>";
    //$result .= ("<pre>SESSION:".print_r($_SESSION,true)."</pre>");
    return $result;
}
コード例 #5
0
function cart32wordpress_settings()
{
    global $sCart32WordPressAccessCode, $sCart32URL, $sC32WebURL, $sClientCode, $dblStartTime, $blnShowSetupWizard, $sAccountInfo, $blnAddViewCartToMenu, $sViewCartText;
    if (isset($_POST['info_update'])) {
        if ($_POST["action"] == 'save_view_cart_section') {
            update_option('cart32_wp_add_view_cart_to_menu', $_POST["cart32_wp_add_view_cart_to_menu"]);
            update_option('cart32wp_view_cart_text', $_POST["cart32wp_view_cart_text"]);
            if (get_option('cart32_wp_add_view_cart_to_menu') == 'No') {
                $blnAddViewCartToMenu = false;
            } else {
                $blnAddViewCartToMenu = true;
            }
            $sViewCartText = get_option('cart32wp_view_cart_text');
            if ($sViewCartText == '') {
                $sViewCartText = 'View Shopping Cart';
            }
        } else {
            update_option('cart32wp_client_code', $_POST["cart32wp_client_code"]);
            update_option('cart32wp_cart32_url', $_POST["cart32wp_cart32_url"]);
            update_option('cart32wp_c32web_url', $_POST["cart32wp_c32web_url"]);
            update_option('cart32wp_access_code', $_POST["cart32wp_access_code"]);
            update_option('cart32wp_account_info', $_POST["cart32wp_account_info"]);
            //reset variables
            $sClientCode = get_option("cart32wp_client_code");
            $sCart32URL = get_option("cart32wp_cart32_url");
            $sC32WebURL = get_option("cart32wp_c32web_url");
            $sCart32WordPressAccessCode = get_option('cart32wp_access_code');
            $sAccountInfo = get_option("cart32wp_account_info");
            $blnShowSetupWizard = false;
            if (get_option('cart32_wp_add_view_cart_to_menu') == 'No') {
                $blnAddViewCartToMenu = false;
            } else {
                $blnAddViewCartToMenu = true;
            }
            $sViewCartText = get_option('cart32wp_view_cart_text');
            if ($sViewCartText == '') {
                $sViewCartText = 'View Shopping Cart';
            }
            SendWordPressInfoToCart32(true, '');
            if ($sCart32WordPressAccessCode == '' || $sClientCode == '' || $sCart32URL == '' || $sC32WebURL == '' || $sAccountInfo == '') {
                $blnShowSetupWizard = true;
            }
        }
    }
    //if blank put in default
    if ($sCart32URL == '') {
        $sCart32URL = 'https://dev8.cart32.com/cgi-bin/cart32.exe';
        update_option('cart32wp_cart32_url', $sCart32URL);
    }
    if ($sC32WebURL == '') {
        $sC32WebURL = 'https://dev8.cart32.com/cgi-bin/c32web.exe';
        update_option('cart32wp_c32web_url', $sC32WebURL);
    }
    //TEMP SECTION START
    if (false) {
        //if (true) {
        echo "<div class=postbox>";
        echo "<h3 style=\"padding:7px;\">Temp Section</h3>";
        echo "<div class=inside>";
        echo "BlogName=" . get_option('blogname') . "<br>";
        echo "Cart32 WordPress Access Code = {$sCart32WordPressAccessCode}<br>";
        echo "Client Code = {$sClientCode}<br>";
        echo "Cart32URL = {$sCart32URL}<br>";
        echo "C32WebURL = {$sC32WebURL}<br>";
        echo "AccountInfo = {$sAccountInfo}<br>";
        echo "plugin_dir_url() = " . plugin_dir_url('') . "<br>";
        if ($blnShowSetupWizard) {
            echo "Show Setup Wizard";
        } else {
            echo "Do Not Show Setup Wizard";
        }
        echo "</div></div>";
    }
    //TEMP SECTION END
    echo "<img src=\"" . plugins_url('cart32_for_wordpress.png', __FILE__) . "\" alt=\"Cart32 For Wordpress\">";
    echo "<H2>Cart32 Shopping Cart for WordPress</H2>";
    if (!$blnShowSetupWizard) {
        echo "<div class=postbox>";
        echo "<h3 style=\"padding:7px;\">Add Products To Your Website One At A Time</h3>";
        echo "<div class=inside>";
        echo "All you need to do is click on the <a class=button href=\"javascript:alert('Press this button when adding a post or page to add a shopping cart button.');\">Insert Cart32 Shopping Cart Button</a> button when adding a post or page to add a product to your website.";
        echo "</div></div>";
        if (false) {
            echo "<div class=postbox>";
            echo "<h3 style=\"padding:7px;\">Or Build Categories and Products</h3>";
            echo "<div class=inside>";
            echo "<a class='button thickbox' title='Set Up Categories' href='javascript:LaunchCart32WebAdminCategories();'>Set Up Categories</a>&nbsp;";
            echo "<a class='button thickbox' title='Set Up Products' href='javascript:LaunchCart32WebAdminProducts();'>Set Up Products</a>&nbsp;";
            echo "</div></div>";
        }
        echo "<form method=\"post\" action=\"" . $_SERVER["REQUEST_URI"] . "\" style=\"margin-top:10px;\">";
        echo "<input type=hidden name=action value=save_view_cart_section>";
        echo "<div class=postbox>";
        echo "<h3 style=\"padding:7px;\">View Cart/Checkout Link On Your Menu</h3>";
        echo "<div class=inside>";
        echo "<table border=0 cellspacing=0 cellpadding=2>";
        echo "<tr><td>Add View Cart/Checkout link to your menu</td><td>";
        echo "<input type=radio name=\"cart32_wp_add_view_cart_to_menu\" id=\"cart32_wp_add_view_cart_to_menu_yes\" value=Yes " . ischecked($blnAddViewCartToMenu) . "> Yes &nbsp;&nbsp;&nbsp;";
        echo "<input type=radio name=\"cart32_wp_add_view_cart_to_menu\" id=\"cart32_wp_add_view_cart_to_menu_no\" value=No " . ischecked(!$blnAddViewCartToMenu) . "> No ";
        echo "</td></tr>";
        echo "<tr><td>View Shopping Cart/Checkout Text</td>";
        echo "<td><input type=text name=cart32wp_view_cart_text id=cart32wp_view_cart_text value=\"{$sViewCartText}\" size=40></td></tr>";
        echo "<tr><td></td><td><input type=\"submit\" name=\"info_update\" value=\"Save\" /></td></tr>";
        echo "</table>";
        echo "</div></div>";
        echo "</form>";
    }
    echo "<div class=postbox>";
    echo "<h3 style=\"padding:7px;\">Cart32 Shopping Cart Settings</h3>";
    echo "<div class=inside>";
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    // SET UP WIZARD
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    echo "<form method=\"post\" action=\"" . $_SERVER["REQUEST_URI"] . "\" style=\"margin-top:10px;\">";
    echo "<input type=hidden name=action value=\"\">";
    echo "<input type=hidden name=cart32wp_access_code id=cart32wp_access_code value=\"\">";
    echo "<input type=hidden name=cart32wp_account_info id=cart32wp_account_info value=\"\">";
    echo "<div id=WizardStep1>";
    echo "  <h3>Setup Wizard Step 1.  Connect WordPress To A Cart32 Account</h3>";
    echo "  Choose One: <input type=radio name=HaveACart32Account value=Y id=HaveRadioYes onclick=\"WizardNextSlide(1)\"> <label for=HaveRadioYes>I already have a Cart32 Account</label>&nbsp;&nbsp;&nbsp;<input type=radio name=HaveACart32Account value=N id=HaveRadioNo onclick=\"WizardNextSlide(1)\"> <label for=HaveRadioNo>I do not have a Cart32 Account</label>";
    echo "  <br><br><a class=button href=\"javascript:WizardNextSlide(1)\">Next</a>";
    echo "</div>";
    echo "<div id=WizardStep2>";
    echo "  <div id=WizardStep2a>";
    echo "      <h3>Setup Wizard Step 2.  Enter Your Cart32 Account Information</h3>";
    echo "      Visit your Cart32 Web Administratration and go to the Store & Pages -> Wordpress tab to get the following fields:";
    echo "      <table border=0 cellspacing=0 cellpadding=2>";
    echo "      <tr><td>Cart32 Address</td><td><input type=\"text\" name=\"cart32wp_cart32_url\" id=\"cart32wp_cart32_url\" value=\"{$sCart32URL}\" maxlength=150 size=50 /></td></tr>";
    echo "      <tr><td>C32Web Address</td><td><input type=\"text\" name=\"cart32wp_c32web_url\" id=\"cart32wp_c32web_url\" value=\"{$sC32WebURL}\" maxlength=150 size=50 /></td></tr>";
    echo "      <tr><td>Cart32 Account</td><td><input type=\"text\" name=\"cart32wp_client_code\" id=\"cart32wp_client_code\" value=\"{$sClientCode}\" maxlength=20 size=20 /></td></tr>";
    echo "      <tr><td>Cart32 Password</td><td><input type=\"password\" name=\"cart32wp_client_password\" id=\"cart32wp_client_password\" value=\"\" maxlength=20 size=20 /></td></tr>";
    //   echo "      <tr><td></td><td><input type=\"submit\" name=\"info_update\" value=\"Save\" /></td></tr>";
    echo "      </table>";
    echo "  </div>";
    echo "  <div id=WizardStep2b>";
    echo "      <h3>Setup Wizard Step 2. Get A Cart32 Account</h3>";
    echo "      Fill out this form to create a free Cart32 trial.<br>";
    echo "      <table border=0 cellspacing=0 cellpadding=2>";
    echo "      <tr><td>Site Name or Company Name</td><td><input type=\"text\" name=\"cart32wp_newaccount_name\" id=\"cart32wp_newaccount_name\" value=\"" . get_option('blogname') . "\" maxlength=30 size=30 /></td></tr>";
    echo "      <tr><td>First and Last Name</td><td><input type=\"text\" name=\"cart32wp_first_last_name\" id=\"cart32wp_first_last_name\" value=\"\" maxlength=50 size=30 /></td></tr>";
    echo "      <tr><td>Email Address</td><td><input type=\"text\" name=\"cart32wp_email\" id=\"cart32wp_email\" value=\"\" maxlength=50 size=30 /></td></tr>";
    echo "      </table>";
    echo "  </div>";
    echo "  <br><br><a class=button href=\"javascript:WizardPreviousSlide(2)\">Back</a>";
    echo "  <a class=button href=\"javascript:WizardNextSlide(2)\">Next</a>";
    echo "</div>";
    echo "<div id=WizardStep3>";
    echo "  <div id=WizardStep3a>";
    echo "    <h3>Setup Wizard Step 3. </h3>";
    //check to see if they are on a high enough version and if set set up WP connection
    echo "      <div id=WizardStep3aContent>";
    //JS will fill in this info
    echo "      </div>";
    echo "  </div>";
    echo "  <div id=WizardStep3b>";
    echo "    <h3>Setup Wizard Step 3. </h3>";
    echo "      <div id=WizardStep3bContent>WizardStep3bContent";
    //JS will fill in this info
    echo "      </div>";
    echo "  </div>";
    echo "  <br><br><a class=button href=\"javascript:WizardPreviousSlide(3)\">Back</a>";
    //echo "  <a class=button href=\"javascript:WizardNextSlide(3)\">Next</a>";
    echo "</div>";
    echo "</div></form>";
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    // MAIN SETTINGS SECTION
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    echo "<div id=\"Cart32WordPressSettingsDiv\" style=\"padding:6px;\">";
    echo "<div id=TrialInfoDiv></div>";
    echo "  <div id=Cart32GettingStartedDiv>";
    echo "      This is where you set up all the options for your shopping cart including shipping, tax, discounts and much, much more.<br>";
    echo "      <br><a href=\"javascript:LaunchCart32WebAdmin()\" class=button>Launch Cart32 Web Administration</a><br>";
    echo "  </div>";
    echo "<br><br><br>If you need a new account or need to start over then <form method=\"post\" action=\"" . $_SERVER["REQUEST_URI"] . "\" style=\"margin-top:10px;\">";
    echo "<input type=hidden name=cart32wp_rerunwizard id=cart32wp_rerunwizard value=Y>";
    echo "<input type=submit class=button value=\"Re-run Setup Wizard\">";
    echo "</form>";
    echo "<form method=post action=\"{$sC32WebURL}\" target=\"C32WebWindow\" name=\"C32WebForm\" id=\"C32WebForm\">";
    echo "<input type=hidden name=client value=\"{$sClientCode}\">";
    echo "<input type=hidden name=wpcode value=\"{$sCart32WordPressAccessCode}\">";
    echo "<input type=hidden name=tabname value=\"Home\">";
    echo "</form>";
    echo "</div>";
    echo "</div>";
    //close web admin area
    echo "<script language=\"javascript\">";
    echo "  function CheckSlide(iSlide) {";
    echo "     switch (iSlide) {";
    echo "        case 1:if(!document.getElementById('HaveRadioYes').checked && !document.getElementById('HaveRadioNo').checked){alert('Please make a choice.');return false;}else return true;break;";
    echo "        case 2:if(document.getElementById('HaveRadioNo').checked && document.getElementById('cart32wp_newaccount_name').value==''){alert('Please enter a site name or company name.');document.getElementById('cart32wp_newaccount_name').focus();return false;}";
    echo "           else if(document.getElementById('HaveRadioNo').checked && document.getElementById('cart32wp_first_last_name').value==''){alert('Please enter your first and last name.');document.getElementById('cart32wp_first_last_name').focus();return false;}";
    echo "           else if(document.getElementById('HaveRadioNo').checked && document.getElementById('cart32wp_email').value==''){alert('Please enter your email address.');document.getElementById('cart32wp_email').focus();return false;}";
    echo "           else if(document.getElementById('HaveRadioNo').checked){return true;}";
    echo "           else{if(document.getElementById('HaveRadioYes').checked){if(document.getElementById('cart32wp_cart32_url').value==''||document.getElementById('cart32wp_c32web_url').value==''||document.getElementById('cart32wp_client_password').value==''||document.getElementById('cart32wp_cart32_url').value==''){alert('Please enter values into all fields.');return false;}else{return true;}}}break;";
    echo "     }";
    echo "  }";
    echo "  function WizardNextSlide(iSlide) {if(CheckSlide(iSlide)){HandleSubSlides(iSlide+1);jQuery('#WizardStep'+iSlide).slideToggle('25');jQuery('#WizardStep'+(iSlide+1)).slideToggle('25');}}";
    echo "  function WizardPreviousSlide(iSlide) {HandleSubSlides(iSlide-1);jQuery('#WizardStep'+iSlide).slideToggle('25');jQuery('#WizardStep'+(iSlide-1)).slideToggle('25');}";
    echo "  function HandleSubSlides(iSlide) {";
    echo "     switch (iSlide) {";
    echo "        case 2:";
    echo "           if (document.getElementById('HaveRadioYes').checked){jQuery('#WizardStep2a').show();jQuery('#WizardStep2b').hide();}";
    echo "           else {jQuery('#WizardStep2b').show();jQuery('#WizardStep2a').hide();}";
    echo "           break;";
    echo "        case 3:";
    echo "           if (document.getElementById('HaveRadioYes').checked){jQuery('#WizardStep3a').show();jQuery('#WizardStep3b').hide();HandleSlideAction('3a');}";
    echo "           else {jQuery('#WizardStep3b').show();jQuery('#WizardStep3a').hide();HandleSlideAction('3b');}";
    echo "           break;";
    echo "     }";
    echo "  }";
    echo "  function HandleSlideAction(sSlide) {";
    echo "     switch (sSlide) {";
    echo "        case '3a':";
    echo "           jQuery('#WizardStep3aContent').html('<img src=\"../wp-includes/images/wpspin.gif\"> Contacting Cart32, please wait ...');";
    echo "           sCart32URL=document.getElementById('cart32wp_cart32_url').value;";
    echo "           sC32WebURL=document.getElementById('cart32wp_c32web_url').value;";
    echo "           sClientCode=document.getElementById('cart32wp_client_code').value;";
    echo "           sClientPassword=document.getElementById('cart32wp_client_password').value;";
    echo "           sQS='';";
    echo "           sVersion='';";
    echo "           iVersion=0;";
    echo "           sJSON='';";
    echo "           fReturn=function(blnSuccess,sReturn){";
    echo "              if(blnSuccess){";
    //see if it's really succesful.  'Cart32' will be in it
    echo "                 if (sReturn.indexOf('Cart32')<0) blnSuccess=false;";
    echo "              }";
    echo "              if(blnSuccess){";
    echo "                 var objHTML=document.createElement('div');";
    //parse out the version from the HTML returned
    echo "                 objHTML.innerHTML=sReturn;";
    echo "                 ArrSpans=objHTML.getElementsByTagName('span');";
    //put all spans in an array, then go through each one looking for id=MessageTableTitle.  That will have the version string
    echo "                 for(i=0;i<ArrSpans.length;i++) {";
    echo "                    if (ArrSpans[i].id=='MessageTableTitle') sVersion=ArrSpans[i].innerHTML;";
    echo "                    if (ArrSpans[i].id=='JSONResponse') sJSON=ArrSpans[i].innerHTML;";
    echo "                 }";
    echo "                 iMinVersion=8.03;";
    echo "                 iVersion=parseFloat(sVersion.replace('Cart32 v',''));";
    echo "                 if (iVersion < iMinVersion) {s='Your version of Cart32 does not support the Wordpress Plug-In.  You need to upgrade to Cart32 v'+iMinVersion+' or above.'}";
    echo "                 else {";
    echo "                    var objJSON = jQuery.parseJSON(sJSON);";
    echo "                    s='';";
    echo "                    if (objJSON.Success=='1') {";
    echo "                       document.getElementById('cart32wp_account_info').value='A';";
    echo "                       document.getElementById('cart32wp_access_code').value=objJSON.WordPressAccessCode;";
    echo "                       s+=objJSON.Message+' <input type=\"submit\" name=\"info_update\" value=\"Click Here To Complete The Wizard\" class=button />';";
    echo "                    } else s+=objJSON.Message;";
    echo "                 }";
    echo "                 jQuery('#WizardStep3aContent').html(s);";
    echo "              } else {jQuery('#WizardStep3aContent').html('There was an error connecting to Cart32.  Please double check your settings and try again.');}";
    echo "           };";
    echo "           CallCart32(sCart32URL,sC32WebURL,sClientCode,sClientPassword,fReturn);";
    echo "           break;";
    echo "        case '3b':";
    echo "           jQuery('#WizardStep3bContent').html('<img src=\"../wp-includes/images/wpspin.gif\"> Creating Cart32 Trial.  Please wait (this can take 30-60 seconds) ...');";
    //make call to Cart32.com to create a free trial
    //return from connecting WP to Cart32 after creating trial
    echo "           fReturnTrialConnect=function(blnSuccess,sReturn){";
    echo "              var objHTML=document.createElement('div');";
    //parse out the version from the HTML returned
    echo "              objHTML.innerHTML=sReturn;";
    echo "              ArrSpans=objHTML.getElementsByTagName('span');";
    //put all spans in an array, then go through each one looking for id=MessageTableTitle.  That will have the version string
    echo "              for(i=0;i<ArrSpans.length;i++) {";
    echo "                 if (ArrSpans[i].id=='MessageTableTitle') sVersion=ArrSpans[i].innerHTML;";
    echo "                 if (ArrSpans[i].id=='JSONResponse') sJSON=ArrSpans[i].innerHTML;";
    echo "              }";
    echo "              var objJSON = jQuery.parseJSON(sJSON);";
    echo "              s='';";
    //   echo "              s='Success='+objJSON.Success+'<br>Message='+objJSON.Message+'<br>WPAccessCode='+objJSON.WordPressAccessCode+'<br><br>';";
    echo "              if (objJSON.Success=='1') {";
    echo "                 document.getElementById('cart32wp_access_code').value=objJSON.WordPressAccessCode;";
    echo "                 s+='Cart32 Account Successfully Created <input type=\"submit\" name=\"info_update\" value=\"Click Here To Complete The Wizard\" class=button />';";
    echo "              } else s+='Account not created successfully.  Please contact Cart32 Support: <a href=\"mailto:support@cart32.com\">support@cart32.com</a>';";
    echo "              jQuery('#WizardStep3bContent').html(s);";
    echo "           };";
    //return function from creating trial.  Next connect WP to Cart32
    echo "           fReturnTrial=function(blnSuccess,sReturn){";
    echo "              var objJSON = jQuery.parseJSON(sReturn);";
    echo "                document.getElementById('cart32wp_cart32_url').value=objJSON.Cart32URL;";
    echo "                document.getElementById('cart32wp_c32web_url').value=objJSON.C32WebURL;";
    echo "                document.getElementById('cart32wp_client_code').value=objJSON.ClientCode;";
    echo "                document.getElementById('cart32wp_account_info').value='T';";
    //call back to Cart32 to connect it to WP
    echo "                CallCart32(objJSON.Cart32URL,objJSON.C32WebURL,objJSON.ClientCode,objJSON.ClientPassword,fReturnTrialConnect);";
    echo "           };";
    echo "           CreateCart32Trial(document.getElementById('cart32wp_newaccount_name').value,document.getElementById('cart32wp_first_last_name').value,document.getElementById('cart32wp_email').value,fReturnTrial);";
    echo "           break;";
    echo "     }";
    echo "  }";
    echo "  function CreateCart32Trial(sCompanyName,sFirstLastName,sEmail,fReturn){";
    echo "     sURL='" . plugins_url('cart32popup.php', __FILE__) . "';";
    echo "     sQS='wp=trial&company='+encodeURIComponent(sCompanyName)+'&firstlastname='+encodeURIComponent(sFirstLastName)+'&email='+encodeURIComponent(sEmail);";
    echo "     jQuery.ajax({type:'POST',data:sQS,url:sURL,success:function(data){fReturn(true,data);},error:function(XMLHttpRequest, textStatus, errorThrown){fReturn(false,'Error');}});";
    echo "  }";
    echo "  function CallCart32(sCart32URL,sC32WebURL,sClientCode,sClientPassword,fReturn){";
    echo "     sURL='" . plugins_url('cart32popup.php', __FILE__) . "';";
    echo "     sQS='wp=y&carturl='+encodeURIComponent(sCart32URL)+'&c32weburl='+encodeURIComponent(sC32WebURL)+'&clientcode='+encodeURIComponent(sClientCode)+'&clientpassword='******'POST',data:sQS,url:sURL,success:function(data){fReturn(true,data);},error:function(XMLHttpRequest, textStatus, errorThrown){fReturn(false,'Error');}});";
    echo "  }";
    echo "  function CheckAccountInfo(sCart32URL,sClientCode,fReturn){";
    echo "     sURL='" . plugins_url('cart32popup.php', __FILE__) . "';";
    echo "     sQS='wp=accountinfo&carturl='+encodeURIComponent(sCart32URL)+'&clientcode='+encodeURIComponent(sClientCode);";
    echo "     jQuery.ajax({type:'POST',data:sQS,url:sURL,success:function(data){fReturn(true,data);},error:function(XMLHttpRequest, textStatus, errorThrown){fReturn(false,'Error');}});";
    echo "  }";
    echo "  function LaunchCart32WebAdmin(){x=window.open('', 'C32WebWindow', 'width=1100,height=750,resizable=yes,scrollbars=yes');document.C32WebForm.tabname.value='Home';document.C32WebForm.submit();}";
    echo "  function LaunchCart32WebAdminCategories(){x=window.open('', 'C32WebWindow', 'width=1100,height=750,resizable=yes,scrollbars=yes');document.C32WebForm.tabname.value='Store and Pages.Categories';document.C32WebForm.submit();}";
    echo "  function LaunchCart32WebAdminProducts(){x=window.open('', 'C32WebWindow', 'width=1100,height=750,resizable=yes,scrollbars=yes');document.C32WebForm.tabname.value='Store and Pages.Products';document.C32WebForm.submit();}";
    echo "  jQuery(function() {";
    echo "     for (i=1;i<=3;i++) jQuery('#WizardStep'+i).hide();";
    //hide all steps of the wizard
    if ($blnShowSetupWizard) {
        echo "jQuery('#Cart32WordPressSettingsDiv').hide();jQuery('#WizardStep1').slideToggle('25');";
    } else {
        if ($sAccountInfo != 'A') {
            echo "function fCheckAccountInfoReturn(blnSuccess,sReturn) {";
            //echo "   alert(sReturn);";
            echo "   var objJSON = jQuery.parseJSON(sReturn);";
            echo "   var s=objJSON.Message;";
            echo "   jQuery('#TrialInfoDiv').html('<span style=\"border:1px solid #333333;padding:6px;background-color:#5486c5;color:#ffffff;\">'+s+'</span><br><br><br>');";
            echo "};";
            echo "   jQuery('#TrialInfoDiv').html('<img src=\"../wp-includes/images/wpspin.gif\"> Loading Trial Account Information ...<br><br>');";
            echo "CheckAccountInfo('{$sCart32URL}','{$sClientCode}',fCheckAccountInfoReturn);";
        }
    }
    echo "  });";
    echo "</script>";
}
コード例 #6
0
ファイル: table.php プロジェクト: HeLanDou/free-time
?>
></td>
            <td><input type="checkbox" name="Thur_e" value="1" <?php 
ischecked('Thur_e');
?>
></td>
            <td><input type="checkbox" name="Fri_e" value="1" <?php 
ischecked('Fri_e');
?>
></td>
            <td><input type="checkbox" name="Sat_e" value="1" <?php 
ischecked('Sat_e');
?>
></td>
            <td><input type="checkbox" name="Sun_e" value="1" <?php 
ischecked('Sun_e');
?>
></td>
          </tr>
        </table>
        <div class="form-group">
          <label for="extra">备注</label>
          <textarea class="form-control" rows=3 id="extra" name="extra" maxlength=100 placeholder="特殊要求可以写在这里"><?php 
echo $result['extra'];
?>
</textarea>
        </div>
        <div style="text-align:center">
          <button class="btn btn-primary" id="submit" type="button">提交</button>
        </div>
      </form>