104 lines
2.8 KiB
PHP
Raw Normal View History

2009-05-13 16:04:48 +00:00
<?php
/**
* @file
* Liste des pays
*
*/
2009-05-14 09:59:52 +00:00
setDbConn('intersud');
2009-05-13 16:04:48 +00:00
$q = Doctrine_Query::create()
2009-05-14 09:59:52 +00:00
->from('Country c')
->leftJoin('c.Price p, c.Delais d')
->setHydrationMode(Doctrine::HYDRATE_ARRAY);
2009-05-13 16:04:48 +00:00
$results = $q->execute();
2009-05-14 09:59:52 +00:00
$firephp->log($results, 'results');
2009-05-13 16:04:48 +00:00
?>
<script>
$(document).ready(function() {
2009-05-14 09:59:52 +00:00
$('.status').editable('./modules/intersud/payssave.php', {
2009-05-13 16:04:48 +00:00
data : "{'actif':'actif','inactif':'incatif'}",
type : 'select',
event : 'dblclick',
indicator : 'Sauvegarde...',
tooltip : 'Double-Clique pour <20>diter...',
submitdata : {col: 'status'}
});
2009-05-14 09:59:52 +00:00
$('.lib').editable('./modules/intersud/payssave.php', {
2009-05-13 16:04:48 +00:00
event : 'dblclick',
indicator : 'Sauvegarde...',
tooltip : 'Double-Clique pour <20>diter...',
submitdata : {col: 'lib'}
});
2009-05-14 09:59:52 +00:00
$('.code').editable('./modules/intersud/payssave.php', {
2009-05-13 16:04:48 +00:00
event : 'dblclick',
indicator : 'Sauvegarde...',
tooltip : 'Double-Clique pour <20>diter...',
submitdata : {col: 'code'}
});
});
</script>
<table>
2009-05-14 09:59:52 +00:00
<tr>
<th colspan="4">Information Pays</th>
<th colspan="2">Prix</th>
<th colspan="2">D<EFBFBD>lais</th>
</tr>
2009-05-13 16:04:48 +00:00
<tr>
<th>Lib<EFBFBD>l<EFBFBD></th>
<th>Pays</th>
<th>Code</th>
<th>Status</th>
2009-05-14 09:59:52 +00:00
<th>Normal</th>
<th>Rapide</th>
<th>Normal</th>
<th>Rapide</th>
2009-05-13 16:04:48 +00:00
</tr>
<?php
foreach($results as $pays){
?>
<tr>
<td align="center"><div id="<?php print $pays['id']; ?>" class="lib"><?php print $pays['lib'];?></div></td>
2009-05-14 09:59:52 +00:00
<td align="center"><div id="<?php print $pays['id']; ?>" class="graydon_country"><?php print $pays['intersud_country'];?></div></td>
2009-05-13 16:04:48 +00:00
<td align="center"><div id="<?php print $pays['id']; ?>" class="code"><?php print $pays['code'];?></div></td>
<td align="center"><div id="<?php print $pays['id']; ?>" class="status"><?php print $pays['status'];?></div></td>
2009-05-14 09:59:52 +00:00
<td><?php print $pays['Price']['normal'];?></td>
<td><?php print $pays['Price']['rapide'];?></td>
<td><?php print $pays['Delais']['normalDe'].' <20> '.$pays['Delais']['normalA'].' Jours';?></td>
<td><?php print $pays['Delais']['rapideDe'].' <20> '.$pays['Delais']['rapideA'].' Jours';?></td>
2009-05-13 16:04:48 +00:00
</tr>
<?php
}
?>
</table>
<form method="post" action="./?q=graydon/country/add">
<table>
<tr><td colspan="4">Ajouter un pays : </td></tr>
<td align="center"><input type="text" name="lib"/></td>
<td align="center">
<select name="graydon_country">
<?php
require_once 'intersud/pays.php';
foreach($tabPays as $kPays => $vPays ){
print '<option value="'.$kPays.'">'.$vPays['display'].'</option>';
}
?>
</select>
</td>
<td align="center"><input type="text" name="code" size="2"/></td>
<td align="center">
<select name="status">
<option value="actif">actif</option>
<option value="inactif">inactif</option>
</select>
</td>
<td colspan="4"><input type="submit" name="submit"/></td>
</table>
</form>
<?php
?>