From d58d9caf04665fc4cbd18a7698b31a5d6a24eb4a Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 7 Mar 2008 22:00:55 +0000 Subject: [PATCH] ebl Add sql mode --- docs/home-page/en/pages/testimonial.php | 137 ++++++++++++++++++------ 1 file changed, 107 insertions(+), 30 deletions(-) diff --git a/docs/home-page/en/pages/testimonial.php b/docs/home-page/en/pages/testimonial.php index 88e85110..1b20d295 100644 --- a/docs/home-page/en/pages/testimonial.php +++ b/docs/home-page/en/pages/testimonial.php @@ -272,31 +272,31 @@ function validate_testimonial (form) { 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++; @@ -516,14 +516,14 @@ while(list ($key, $val) = each ($catalog_lst)) maxlength='10' value=''> -*Total # of GB saved every month: +*Total # of GB saved every month: -*Number # of Files: +*Number # of Files: + id='number_files' size='10' maxlength='15' value=''> @@ -576,6 +576,24 @@ Nics: + +

Getting backup information

+To get Total # of GB saved every month, you can run this query on you catalog (just adapt the starttime condition and round the result) +
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobBytes)/1073741824 FROM Job WHERE StartTime > '2008-02-07' AND Type = 'B'
+
+ +To know how many files are in your catalog, you can run this: +
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobFiles) FROM Job WHERE Type = 'B'
+
+ + +

Privacy Notice

@@ -633,6 +651,7 @@ if ($_REQUEST['action'] == 'Modify') { $form['filename'] = $filename; $form['id'] = $token; + $form['visible']=0; save_formul($form); send_email($form['id'], $form['email_address']); @@ -877,7 +896,9 @@ function get_formul() '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]; } } @@ -1024,39 +1045,74 @@ function print_formul_file($filename, $admin) { 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'); - + -- 2.39.5