Example #1
0
function saveComment($server_name, $server_port, $db_name, $table_name, $mysql_field_content_list)
{
    $retArray = array();
    $collect = getCollection();
    foreach ($mysql_field_content_list as $mysql_field_content) {
        $cond_array = array("server_name" => $server_name, "server_port" => $server_port, "database" => $db_name, "table_name" => $table_name, "field_name" => $mysql_field_content["fieldName"]);
        $val_array = array("server_name" => $server_name, "server_port" => $server_port, "database" => $db_name, "table_name" => $table_name, "field_name" => $mysql_field_content["fieldName"], "chinese_name" => $mysql_field_content["chineseName"], "comment_str" => $mysql_field_content["commentStr"]);
        $result = $collect->update($cond_array, $val_array, array("upsert" => true));
    }
}
#echo "<pre>"; print_r(getCollection($shop, $token));
$product_list = array();
$All_product_array = getAllProuctData($shop, $token);
if (count($All_product_array["products"]) > 0 && $All_product_array["status"] == "1") {
    $product_list = $All_product_array["products"];
    /*$prod_arr_temp = $All_product_array["products"];
      for($i=0;$i<count($prod_arr_temp);$i++){
          $prod_id = $prod_arr_temp[$i]["id"];
          $product_list[$prod_id]["title"] = $prod_arr_temp[$i]["title"];  
          $product_list[$prod_id]["handle"] = $prod_arr_temp[$i]["handle"];  
          $product_list[$prod_id]["image"] = $prod_arr_temp[$i]["image"]["src"];  
          $product_list[$prod_id]["price"] = $prod_arr_temp[$i]["variants"][0]["price"];  
      }*/
}
$collection_list = array();
$All_coll_array = getCollection($shop, $token);
if (count($All_coll_array["result"]) > 0 && $All_coll_array["status"] == "1") {
    $collection_list = $All_coll_array["result"];
    $collection_list = array_values($collection_list);
}
if (count($product_list) > 0 || count($collection_list) > 0) {
    #echo "<pre>"; print_r($product_list);
    #echo "<pre>"; print_r($collection_list);
}
?>
    
<html>
<head>
<?php 
include 'header.php';
?>
Example #3
0
} else {
    if (empty($_POST['price']) && !empty($_POST['longtitudeMax']) && !empty($_POST['latitudeMax']) && !empty($_POST['longtitudeMin']) && !empty($_POST['latitudeMin'])) {
        //output houses that sits in such lo and la
        $tuple = getCollection();
        $houses = $tuple["collection"];
        $lonRange = array('longtitude' => array('$gt' => (double) $_POST['longtitudeMin'], '$lt' => (double) $_POST['longtitudeMax']));
        $latRange = array('latitude' => array('$gt' => (double) $_POST['latitudeMin']), '$lt' => (double) $_POST['latitudeMax']);
        $cursor = $houses->find(array('$and' => array($lonRange, $latRange)));
        $num = 0;
        while ($cursor != null && $cursor->hasNext()) {
            $array[$num] = $cursor->next();
            $num = $num + 1;
        }
        $tuple["connection"]->close();
    } else {
        if (!empty($_POST['price'])) {
            //output houses that are between this price
            $tuple = getCollection();
            $houses = $tuple["collection"];
            $priceRange = array('price' => array('$lt' => intval($_POST['price'])));
            $cursor = $houses->find($priceRange);
            $num = 0;
            while ($cursor != null && $cursor->hasNext()) {
                $array[$num] = $cursor->next();
                $num = $num + 1;
            }
            $tuple["connection"]->close();
        }
    }
}
echo json_encode($array);
Example #4
0
                echo '<br /><br />';
                echo '<div class="row">';
                echo '<div class="col-lg-12">';
                echo '<legend class="text-left">Offres de ' . htmlspecialchars($row_user['prenom']) . ' ' . htmlspecialchars($row_user['nom']) . '</legend>';
                // On récupère la fonction getOffres
                include 'modele/offres/offres_req.php';
                getOffres($user, 'offre', false);
                echo '</div>';
                echo '</div>';
                echo '<br /><br />';
                echo '<div class="row">';
                echo '<div class="col-lg-12">';
                echo '<legend class="text-left">Collection de ' . htmlspecialchars($row_user['prenom']) . ' ' . htmlspecialchars($row_user['nom']) . '</legend>';
                // On récupère la fonction getCollection
                include 'modele/cups/collec_req.php';
                getCollection($user, false);
            } else {
                echo '<div class="alert alert-danger text-center">Erreur critique. Plusieurs utilisateurs ont le même login.</div>';
            }
        } else {
            echo '<div class="alert alert-danger text-center">Ce login n\'est pas valide.</div>';
        }
    }
    ?>
				
			</div>
		</div>
			<br />
			<br />
			<br />
			<br />
Example #5
0
	
	<?php 
    // On appelle le menu et on l'affiche
    include 'nav.php';
    ?>
 
	<!-- Corps du site -->
	<div class="container" style="padding-top: 70px;">
		<div class="row">
			<div class="col-lg-12">
			
			<legend class="text-left">Votre collection</legend>
			<?php 
    // On va appeler la fonction qui permet de récupérer la collection d'un utilisateur
    include 'modele/cups/collec_req.php';
    getCollection($_SESSION['login'], true);
    ?>
				
			</div>
		</div>
	</div>
	
	<?php 
    include 'footer.php';
    ?>
	
	
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" charset="utf-8">
		function removeCup(idCup){