122 lines
3.0 KiB
PHP
Raw Normal View History

2009-05-04 14:26:54 +00:00
<?php
/**
* @file
* Liste des prix
*
*/
2009-05-14 09:49:31 +00:00
setDbConn('graydon');
2009-05-04 14:26:54 +00:00
$q = Doctrine_Query::create($conn)
->from('Price p')
->leftJoin('p.Country c');
$results = $q->fetchArray();
2009-08-11 06:46:59 +00:00
$view = arg(2,$_REQUEST['q']);
switch ($view) {
case "multiplier" :
if (sizeof($_POST) > 0) {
$frm = $_POST;
if(is_numeric($frm['immediate']) || is_numeric($frm['normal']) || is_numeric($frm['superflash'])) {
multiplier($frm);
}
//insere_pays($frm);
//header("Location:".$_SERVER['HTTP_REFERER']);
}
break;
}
/******************************************************************************
* FONCTIONS
*****************************************************************************/
function multiplier($frm) {
/*
* Multiplie les valeurs des colonnes.
* Les champs sont dans la variable $frm
*
*/
$immediate = intval($frm['immediate']);
$normal = intval($frm['normal']);
$superflash = intval($frm['superflash']);
include("../mysql_inc.php");
$sql = "SELECT immediate, normal, superflash FROM price";
$result = mysql_query($sql) or die("Une erreur de connexion <20> la base s'est produite " . __LINE__ . ".<p></p>" . mysql_error());
while($col = mysql_fetc) {
}
mysql_close($connexion);
}
2009-05-04 14:26:54 +00:00
?>
2009-05-11 15:48:50 +00:00
<script>
$(document).ready(function() {
$('.immediate').editable('./modules/graydon/pricesave.php', {
event : "dblclick",
indicator : 'Sauvegarde...',
tooltip : 'Double-Clique pour <20>diter...',
submitdata : {col: "immediate"}
});
$('.normal').editable('./modules/graydon/pricesave.php', {
event : "dblclick",
indicator : 'Sauvegarde...',
tooltip : 'Double-Clique pour <20>diter...',
submitdata : {col: "normal"}
});
$('.superflash').editable('./modules/graydon/pricesave.php', {
event : "dblclick",
indicator : 'Sauvegarde...',
tooltip : 'Double-Clique pour <20>diter...',
submitdata : {col: "superflash"}
});
});
</script>
<style type="text/css">
table td {border-bottom:#ccc 1px solid; margin:0; padding:0;}
</style>
2009-05-04 14:26:54 +00:00
<table>
<tr>
<th>Pays</th>
<th>Immediate</th>
<th>Normal</th>
<th>Superflash</th>
</tr>
<?php
foreach($results as $prix){
?>
<tr>
<td><?php print $prix['Country']['graydon_country'];?></td>
2009-05-11 15:48:50 +00:00
<td align="center"><div id="<?php print $prix['id'];?>" class="immediate"><?php print $prix['immediate'];?></div></td>
<td align="center"><div id="<?php print $prix['id'];?>" class="normal"><?php print $prix['normal'];?></div></td>
<td align="center"><div id="<?php print $prix['id'];?>" class="superflash"><?php print $prix['superflash'];?></div></td>
2009-05-04 14:26:54 +00:00
</tr>
<?php
}
?>
2009-05-11 15:48:50 +00:00
<tr>
2009-08-11 06:46:59 +00:00
<form name="multcol" action="./?q=graydon/prix/multiplier" method="post">
2009-05-11 15:48:50 +00:00
<td>Multiplier les prix par</td>
<td>x <input type="text" name="immediate" value="" size="2"/></td>
<td>x <input type="text" name="normal" value="" size="2"/></td>
<td>x <input type="text" name="superflash" value="" size="2"/></td>
2009-08-11 06:46:59 +00:00
<td><input type="submit" name="submit"/></td>
</form>
2009-06-04 10:35:53 +00:00
</tr>
2009-05-04 14:26:54 +00:00
</table>
<?php
?>