Révision fa2eb127 plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_client2.form.php
plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_client2.form.php | ||
---|---|---|
50 | 50 |
$fk_entitee = $_POST['FK_entitee']; |
51 | 51 |
|
52 | 52 |
//Un pack non attribué |
53 |
$query="SELECT * FROM glpi_plugin_anet_epacks WHERE FK_clientderyxeo='0' AND creation_date='0000-00-00' AND code LIKE 'ABE10%' LIMIT 1;";
|
|
53 |
$query="SELECT * FROM glpi_plugin_anet_epacks WHERE FK_clientderyxeo='0' AND creation_date='0000-00-00' AND code LIKE 'ABE11%' LIMIT 1;";
|
|
54 | 54 |
//$DB->query($query) or die($DB->error()); |
55 | 55 |
$result = $DB->query($query); |
56 | 56 |
$data=$DB->fetch_array($result); |
... | ... | |
60 | 60 |
print "On vient d'en créer un nouveau, re-essayez ..."; |
61 | 61 |
global $DB; |
62 | 62 |
$nb_packs = 1; |
63 |
$prefix = "ABE10-01-";
|
|
63 |
$prefix = "ABE11-01-";
|
|
64 | 64 |
for($i = 0; $i < $nb_packs; $i++) { |
65 | 65 |
srand(); |
66 | 66 |
$code=$prefix . rand(1000,9999) . "-" . chr(rand(65,90)) . chr(rand(65,90)) . chr(rand(65,90)) . chr(rand(65,90)) . "-" . rand(1000,9999); |
67 | 67 |
$password=rand(1000,9999) . "-" . rand(1000,9999); |
68 |
$query="INSERT into glpi_plugin_anet_epacks(creation_date,expiration_date,code,password) values( '0000-00-00' ,'2010-12-31','$code','$password');";
|
|
68 |
$query="INSERT into glpi_plugin_anet_epacks(creation_date,expiration_date,code,password) values( '0000-00-00' ,'2011-12-31','$code','$password');";
|
|
69 | 69 |
print $query; |
70 | 70 |
$DB->query($query);// or die($DB->error()); |
71 | 71 |
} |
Formats disponibles : Unified diff