invalid++;
}
var number = form.elements['number_fd'].value;
- if (number == null || ! number.match(/^[0-9]+$/)) {
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
alertstr += '- Invalid entry for the "Number of Client" field\n';
invalid_fields.push('number_fd');
invalid++;
}
number = form.elements['number_sd'].value;
- if (number == null || ! number.match(/^[0-9]+$/)) {
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
alertstr += '- Invalid entry for the "Number of Storage" field\n';
invalid_fields.push('number_sd');
invalid++;
}
number = form.elements['number_dir'].value;
- if (number == null || ! number.match(/^[0-9]+$/)) {
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
alertstr += '- Invalid entry for the "Number of Director" field\n';
invalid_fields.push('number_dir');
invalid++;
}
number = form.elements['month_gb'].value;
- if (number == null || ! number.match(/^[0-9]+$/)) {
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
alertstr += '- Invalid entry for the "Number GB/month" field\n';
invalid_fields.push('month_gb');
invalid++;
}
number = form.elements['number_files'].value;
- if (number == null || ! number.match(/^[0-9]+$/)) {
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
alertstr += '- Invalid entry for the "File number" field\n';
invalid_fields.push('number_files');
invalid++;
maxlength='10' value=''></td>
</tr>
-<tr><td class='ItemName'><font color='red'>*</font>Total # of GB saved every month:</td>
+<tr><td class='ItemName' title="See bellow how to get this information"><font color='red'>*</font>Total # of GB saved every month:</td>
<td class='ItemValue'><input type='text' class='ItemValue' name='month_gb' size='5'
id='month_gb' maxlength='10' value=''></td>
</tr>
-<tr><td class='ItemName'><font color='red'>*</font>Number # of Files:</td>
+<tr><td class='ItemName' title='See bellow how to get this information'><font color='red'>*</font>Number # of Files:</td>
<td class='ItemValue'><input type='text' class='ItemValue' name='number_files'
- id='number_files' title='select count(1) from File;' size='10' maxlength='15' value=''></td>
+ id='number_files' size='10' maxlength='15' value=''></td>
</tr>
<tr>
</tr>
<tr>
+ <td class="content">
+ <h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Getting backup information </h3>
+To get <i>Total # of GB saved every month</i>, you can run this query on you catalog (just adapt the starttime condition and round the result)
+<pre>
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobBytes)/1073741824 FROM Job WHERE StartTime > '2008-02-07' AND Type = 'B'
+</pre>
+
+To know how many files are in your catalog, you can run this:
+<pre>
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobFiles) FROM Job WHERE Type = 'B'
+</pre>
+ </td>
+</tr>
+<tr>
<td class="content">
<h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Privacy Notice </h3>
$form['filename'] = $filename;
$form['id'] = $token;
+ $form['visible']=0;
save_formul($form);
send_email($form['id'], $form['email_address']);
'country_id','ostype_id', 'redundant_setup','number_fd','number_sd','support',
'month_gb','number_files','catalog_id','number_dir');
foreach ($attribs as $arr) {
- if (preg_match("/^[0-9]+$/", $_REQUEST[$arr])) {
+ $tmp = $_REQUEST[$arr];
+ $tmp = preg_replace("/[,\.]/", "", $tmp);
+ if (preg_match("/^[0-9]+$/", $tmp)) {
$formul[$arr] = $_REQUEST[$arr];
}
}
function dump_sql()
{
- global $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst;
+ global $dat_dir, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst, $version_lst;
+ if (!is_admin()) {
+ return;
+ }
?>
CREATE TABLE dict (lang text, id int, name text, primary key (lang, id));
CREATE TABLE testimonials (
contact_name text,
email_address text,
org_name text,
- title text,
- website text,
- month_gb int,
- number_files bigint,
- number_dir int,
- number_fd int,
- number_sd int,
- org_size int,
- id text,
- publish_contact bool,
- publish_email bool,
- publish_website bool,
- publish_orgname bool,
- publish_orgsize bool,
+ title text DEFAULT '',
+ website text DEFAULT '',
+ filename text DEFAULT '',
+ month_gb int DEFAULT 0,
+ number_files bigint DEFAULT 0,
+ number_dir int DEFAULT 0,
+ number_fd int DEFAULT 0,
+ number_sd int DEFAULT 0,
+ org_size int DEFAULT 0,
+
+ country_id int,
+ ostype_id int,
bacula_version int,
contry_id int,
orgindustry_id int,
orgtype_id int,
- redundant_setup bool,
catalog_id int,
- support bool,
- comments text,
- hardware_comments text
+
+ id text,
+ publish_contact int DEFAULT 0,
+ publish_email int DEFAULT 0,
+ publish_website int DEFAULT 0,
+ publish_orgname int DEFAULT 0,
+ publish_orgsize int DEFAULT 0,
+ redundant_setup int DEFAULT 0,
+ support int DEFAULT 0,
+ comments text DEFAULT '',
+ hardware_comments text DEFAULT '',
+ visible int DEFAULT 0,
+ org_logo text DEFAULT '',
+ date int DEFAULT 0,
+ lastmodifed int DEFAULT 0
);
+
+ CREATE VIEW reference AS SELECT contact_name,email_address,org_name,title,website,hardware_comments,comments,
+ publish_contact,publish_email,publish_orgname,org_size,publish_orgsize,publish_website,
+ redundant_setup,number_fd,number_sd,support,month_gb,number_files,number_dir,date,visible,filename,t.id,
+ orgtype.name AS orgtype,
+ orgindustry.name AS orgindustry,
+ version.name AS bacula_version,
+ country.name AS country,
+ ostype.name AS ostype,
+ catalog.name AS catalog
+ FROM testimonials AS t, dict AS orgtype, dict AS orgindustry, dict AS version, dict AS country, dict AS ostype,
+ dict AS catalog
+
+ WHERE t.orgtype_id = orgtype.id AND orgtype.lang = 'en'
+ AND t.orgindustry_id = orgindustry.id AND orgindustry.lang = 'en'
+ AND t.bacula_version = version.id AND version.lang = 'en'
+ AND t.country_id = country.id AND country.lang = 'en'
+ AND t.ostype_id = ostype.id AND ostype.lang = 'en'
+ AND t.catalog_id = catalog.id AND catalog.lang = 'en';
+
+
+ INSERT INTO dict (lang, id, name) VALUES ('en', 0, 'no');
+ INSERT INTO dict (lang, id, name) VALUES ('en', 1, 'yes');
<?
- $a = array($country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst);
+ $a = array($version_lst, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst);
foreach ($a as $tab) {
while(list ($key, $val) = each ($tab))
{
}
}
}
+ if ($handle = opendir($dat_dir)) {
+ /* Ceci est la facon correcte de traverser un dossier. */
+ while (false !== ($file = readdir($handle))) {
+ if (preg_match("/profile.[a-z0-9\.]+/", $file)) {
+ $tmpv = array();
+ $tmpk = array();
+ $form = load_formul("$dat_dir/$file");
+ while(list ($key, $val) = each ($form))
+ {
+ array_push($tmpv, "'$val'");
+ array_push($tmpk, $key);
+ }
+ echo "INSERT INTO testimonials (";
+ print join(",", $tmpk);
+ echo ") VALUES (";
+ print join(",", $tmpv);
+ echo ");\n";
+ }
+ }
+ closedir($handle);
+ }
}
function print_formul($formul)
<? } ?>
</table>
</td>
- <td>
+ <td align='center' valign='center'>
<? if ($formul['org_logo']) { ?>
<a href="<? echo $formul['org_logo'] ?>" ><img width='150' src="<? echo $formul['org_logo'] ?>"></a>
<? } ?>