Example #1
0
function showCart($cart, $mode)
{
    // build an array to pass
    $products = array();
    foreach ($cart as $ASIN => $product) {
        $ars = getARS('asin', array('asin' => $ASIN, 'mode' => $mode));
        if ($ars) {
            $products[] = $ars->getProduct(0);
        }
    }
    // build the form to link to an Amazon.com shopping cart
    echo '<form method="POST" 
              action="http://www.amazon.com/o/dt/assoc/handle-buy-box">';
    foreach ($cart as $ASIN => $product) {
        $quantity = $cart[$ASIN]['quantity'];
        echo "<input type='hidden' name='asin.{$ASIN}' value='{$quantity}'>";
    }
    echo '<input type="hidden" name="tag-value" value="ASSOCIATEID">';
    echo '<input type="hidden" name="tag_value" value="ASSOCIATEID">';
    echo '<input type="image" src="images/checkout.gif" 
                            name="submit.add-to-cart" 
                            value="Buy From Amazon.com">';
    echo ' When you have finished shopping press checkout to add all the 
         items in your Tahuayo cart to your Amazon cart and complete 
         your purchase.<br />';
    echo '</form>';
    echo '<a href = "index.php?action=emptycart"><img 
           src = "images/emptycart.gif" alt = "Empty Cart" border = 0></a> 
        If you have finished with this cart, you can empty it of all items.
        <br />';
    echo '<h1>Cart Contents</h1>';
    showSummary($products, 1, count($products), $mode, 0, true);
}
Example #2
0
function goAction($act, $category_id, $course_id, $courses, $exercises)
{
    if (!$act || $act == null) {
        $act = "default";
    }
    switch ($act) {
        case 'default':
            showPage();
            break;
        case 'getCategory':
            showCategories();
            break;
        case 'getCategoryJson':
            showCategoryTree();
            break;
        case 'getCourses':
            showCourses($category_id);
            break;
        case 'getTracks':
            showTracks($category_id, $course_id);
            break;
        case 'getScores':
            showScores($category_id, $course_id);
            break;
        case 'getSummary':
            showSummary($category_id, $courses, $exercises);
            break;
        case 'getExcel':
            showExcel($category_id, $courses, $exercises);
            break;
        case 'getCfgs':
            showConfig($category_id, $course_id);
            break;
        case 'saveCfgs':
            $count = $_GET['count'];
            $configs = $_GET['config'];
            setConfig($category_id, $course_id, $count, $configs);
            break;
        case 'createCfgs':
            $quiz_count = @$_GET['count'];
            if (!isset($quiz_count) || $quiz_count == null || $quiz_count <= 0) {
                drawConfigPanel($category_id, $course_id);
            } else {
                drawConfigPanel($category_id, $course_id, $quiz_count);
            }
            break;
        case 'removeCfgs':
            removeConfig($category_id, $course_id);
            break;
        case 'getStudents':
            showStudentConfigs();
            break;
        case 'saveStudents':
            $students = $_GET['s'];
            saveStudentConfigs($students);
            break;
    }
}
function showSearch($search, $page, $mode)
{
    $ars = getARS('search', array('search' => $search, 'page' => $page, 'mode' => $mode));
    $products =& $ars->products();
    if ($products) {
        showSummary($products, $page, $ars->totalResults(), $mode, 0, false, $search);
    } else {
        echo "No products matched your search term";
    }
}
Example #4
0
 public function initCustomer()
 {
     global $SQL_ANY_STRING;
     $query = "SELECT * FROM " . self::$tableName . " WHERE ";
     $lname_string = "";
     $fname_string = "";
     if ($this->lname) {
         $lname_string = self::$lnameStr . ' = "' . $this->lname . '"';
     } else {
         $lname_string = self::$lnameStr . " {$SQL_ANY_STRING}";
     }
     if ($this->fname) {
         $fname_string = " AND " . self::$fnameStr . " = " . '"' . $this->fname . '"';
     } else {
         $fname_string = " AND " . self::$fnameStr . " {$SQL_ANY_STRING}";
     }
     $query = $query . $lname_string . $fname_string;
     // echo "<br/>debug: $query";
     $result = $this->db_conn->query($query);
     if ($result == true) {
         if ($result->num_rows > 1) {
             $result->free();
             // more than one customer with the same name
             // display them in a table
             showSearchPanel();
             showSummary($query);
             showVersionInfo();
         } else {
             if ($result->num_rows == 1) {
                 $result->data_seek(0);
                 $row = $result->fetch_assoc();
                 $custId = $row[self::$custIdStr];
                 $result->free();
                 // single customer found, show the details
                 header("Location: showdetails.php?custId=" . $custId);
             } else {
                 $this->addNewCustomer();
             }
         }
         // adding new user
     } else {
         exit("<h1>Unable to connect to the database!</h1>");
     }
 }
function showCart($cart, $mode)
{
    // build an array to pass
    $products = array();
    foreach ($cart as $ASIN => $product) {
        $ars = getARS('asin', array('asin' => $ASIN, 'mode' => $mode));
        if ($ars) {
            $products[] = $ars->getProduct(0);
        }
    }
    // build the form to link to an Amazon.com shopping cart
    echo "<form method=\"POST\"\n              action=\"http://www.amazon.com/gp/aws/cart/add.html\">";
    foreach ($cart as $ASIN => $product) {
        $quantity = $cart[$ASIN]['quantity'];
        echo "<input type=\"hidden\" name=\"ASIN." . $ASIN . "\"  value=\"" . $ASIN . "\">";
        echo "<input type=\"hidden\" name=\"Quantity." . $ASIN . "\" value=\"" . $quantity . "\">";
    }
    echo "<input type=\"hidden\" name=\"SubscriptionId\" value=\"" . DEVTAG . "\">\n        <input type=\"hidden\" name=\"AssociateTag\" value=\"" . ASSOCIATEID . "\">\n        <input type=\"image\" src=\"images/checkout.gif\"\n               name=\"submit.add-to-cart\" value=\"Buy From Amazon.com\">\n         When you have finished shopping press checkout to add all the\n         items in your Tahuayo cart to your Amazon cart and complete\n         your purchase.\n         </form>\n         <br/><a href=\"index.php?action=emptycart\"><img\n           src=\"images/emptycart.gif\" alt=\"Empty Cart\" border=\"0\"></a>\n        If you have finished with this cart, you can empty it of all items.\n        </form>\n        <br />\n        <h1>Cart Contents</h1>";
    showSummary($products, 1, count($products), $mode, 0, true);
}
Example #6
0
* Include quarantine-specific output functions
*/
include_once 'templates/summary.template.php';
if (!Auth::is_logged_in()) {
    Auth::print_login_msg();
    // Check if user is logged in
}
$_SESSION['sessionNav'] = "Site Quarantine Summary";
$t = new Template(translate('Site Quarantine Summary'));
$db = new DBEngine();
$t->printHTMLHeader();
$t->printWelcome();
$t->startMain();
// Break table into 2 columns, put quick links on left side and all other tables on the right
startQuickLinksCol();
showQuickLinks();
// Print out My Quick Links
startDataDisplayCol();
if (!Auth::isMailAdmin() || !$conf['app']['siteSummary']) {
    CmnFns::do_error_box(translate('Access Denied'));
} else {
    // Print a loading message until database returns...
    printMessage(translate('Loading Summary...'));
    $count_array = $db->get_site_summary();
    showSummary($count_array);
    // Hide the message after the table loads.
    hideMessage(translate('Loading Summary...'));
}
endDataDisplayCol();
$t->endMain();
$t->printHTMLFooter();
*/
// no direct access
defined('_VALID_MOS') or die('Restricted access');
require_once $mainframe->getPath('admin_html');
switch ($task) {
    case 'searches':
        showSearches($option, $task);
        break;
    case 'searchesresults':
        showSearches($option, $task, 1);
        break;
    case 'pageimp':
        showPageImpressions($option, $task);
        break;
    default:
        showSummary($option, $task);
        break;
}
function showSummary($option, $task)
{
    global $database, $mainframe;
    // get sort field and check against allowable field names
    $field = strtolower(mosGetParam($_REQUEST, 'field', ''));
    if (!in_array($field, array('agent', 'hits'))) {
        $field = '';
    }
    // get field ordering or set the default field to order
    $order = strtolower(mosGetParam($_REQUEST, 'order', 'asc'));
    if ($order != 'asc' && $order != 'desc' && $order != 'none') {
        $order = 'asc';
    } else {
Example #8
0
<html>
  <head>
  <title>Form Input Data</title>
  </head>

  <body>
    <?php 
require_once "showall.php";
require_once "tcCustomer.php";
require_once "htmlUtil.php";
showSearchPanel();
showSummary("SELECT * FROM " . tcCustomer::$tableName);
showVersionInfo();
?>

  </body>

</html>