about summary refs log tree commit diff stats
path: root/includes/db.php
blob: 8f305e765d3449501be738ef4afea80697f26f30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/*
       444444444  
      4::::::::4  
     4:::::::::4  
    4::::44::::4  
   4::::4 4::::4   Four Island
  4::::4  4::::4  
 4::::4   4::::4   Written and maintained by Starla Insigna
4::::444444::::444
4::::::::::::::::4  includes/db.php
4444444444:::::444
          4::::4   Please do not use, reproduce or steal the
          4::::4   contents of this file without explicit
          4::::4   permission from Hatkirby.
        44::::::44
        4::::::::4
        4444444444
*/

if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}

require('headerproc.php');

// Make the database connection.
mysql_connect($dbwebhost, $dbwebuser, $dbwebpasswd);
mysql_select_db($dbwebname);

function db_single_select($query)
{
	$getitem1 = $query;
	$getitem2 = mysql_query($getitem1) or die($getitem1);
	$getitem3 = mysql_fetch_array($getitem2);
	return $getitem3;
}

function db_multi_select($query, $callback)
{
	$getitem1 = $query;
	$getitem2 = mysql_query($getitem1) or die($getitem1);
	$i=0;
	while ($getitem3[$i] = mysql_fetch_array($getitem2))
	{
		$callback($getitem3[$i]);
		$i++;
	}
}

function db_count($query)
{
	$cntitem = $query;
	$cntitem2 = mysql_query($cntitem) or die($cntitem);
	$cntitem3 = mysql_fetch_array($cntitem2);

	return $cntitem3['COUNT(*)'];
}

?>
D; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* Four Island UniForm CSS */

/* uniForm */
      .uniForm{
        margin:0; padding:0;
        position:relative;
        width:100%;
        /* user prefs */
        padding:10px 0;
      }

        /* Some generals */
        .uniForm fieldset{
          border:none;
          margin:0; padding:0;
          /* user prefs */
          margin:0 0 7px 0; padding:0 0 10px 0;
          border-bottom:1px solid #efefef;
        }
          .uniForm fieldset legend{
            color:#000; /* Reset IE */
            margin:0; padding:0;
            /* user prefs */
            margin:0 0 .5em 0;
            font:bold small-caps 100%/100% "lucida grande", "lucida sans unicode", "trebuchet ms", arial, verdana, sans-serif;
            letter-spacing:.1em;
            color:#93b5be;
          }

          .ctrlHolder{ /* This is the main unit that contains our form "modules" */
            overflow:hidden;
            margin:0; padding:0;
            clear:both;
            /* user prefs */
            background:#f9f9f9;
            margin:0; padding:7px 4px;
          }

          .buttonHolder{
            overflow:hidden;
            clear:both;
            /* user prefs */
            background:#f9f9f9;
            border:1px solid #ccc; border-width:1px 0;
            margin:10px 0 0 0; padding:10px;
            text-align:right;
          }
            .resetButton{
            }
            .submitButton{
            }

          .uniForm .inlineLabel{
            width:auto;
            float:none;
            display:inline;
            /* user prefs */
            margin:0 2em 0 0;
            font-weight:normal;
          }
            .uniForm .inlineLabel input{
            }
          
          /* Highlighting the rows on input focus */
          .focused{
            background:#FFFCDF url(/theme/images/uf_focused.png);
            border:1px solid #EFE795; border-width:1px 0;
            padding:6px 4px;
          }


          /* Styles for form controls where labels are in line with the input elements */
          /* Set the class to the parent to .inlineLabels */
          .inlineLabels .ctrlHolder{
          }
              .inlineLabels label,
              .inlineLabels .label{
                float:left;
                margin:.3em 0 0 0; padding:0;
                line-height:100%;
                /* user prefs */
                width:30%; 
                font-weight:bold;
              }

              .inlineLabels .textInput,
              .inlineLabels .fileUpload{
                float:left;
                /* user prefs */
                width:68%;
                border:2px solid #dfdfdf;
              }
              .inlineLabels .fileUpload > input{
              }
              
              .inlineLabels .selectInput{
                float:left;
                /* user prefs */
                width:69%;
                border:2px solid #dfdfdf;
              }

              .inlineLabels textarea{
                float:left;
                width:68%;
                /* user prefs */
                border:2px solid #dfdfdf;
                height:12em;
              }

            .inlineLabels .formHint{
              clear:both;
              /* user prefs */
              color:#999;
              margin:.5em 0 0 30%; padding:3px 0;
              font-size:80%;
            }
  
              /* inlineLabels esthetics */
              .inlineLabels .formHint strong{
                padding:0 0 0 14px; 
                background:url(/theme/images/icon_alert.png) 0 0 no-repeat;
                display:inline-block;
              }

  
          /* ########################################################################## */

          /* Styles for form controls where labels are above the input elements */
          /* Set the class to the parent to .blockLabels */
          .blockLabels .ctrlHolder{
          }

              .blockLabels label,
              .blockLabels .label{
                display:block;
                float:none;
                margin:.3em 0; padding:0;
                line-height:100%;
                width:60%;
                /* user prefs */
                font-weight:bold;
                width:auto;
              }
              .blockLabels .label{
                float:left;
                margin-right:3em;
              }

              .blockLabels .textInput{
                float:left;
                width:60%;
                /* user prefs */
                border:2px solid #dfdfdf;
              }
              
              .blockLabels .selectInput{
                float:left;
                width:60%;
                /* user prefs */
                border:2px solid #dfdfdf;
                
              }

              .blockLabels textarea{
                display:block;
                float:left;
                /* user prefs */
                border:2px solid #dfdfdf;
                height:12em;
              }

            .blockLabels .formHint{
              float:right;
              margin:0;
              width:38%;
              clear:none;
              /* user prefs */
              color:#999;
              font-size:80%;
              font-style:italic;
            }

            /* blockLabels esthetics */
            .blockLabels .ctrlHolder{
              border:1px solid #dfdfdf; border-width:1px 0;
              margin-top:-1px;
            }

            .blockLabels .focused{
              padding:7px 4px;
            }

          /* ########################################################################## */

          /* Focus pseudoclasses */
          .ctrlHolder .textInput:focus{
            border-color:#DFD77D;
          }
          div.focused .textInput:focus{
          }
          div.focused .formHint{
            color:#000;
          }

          /* Required asterisk styling, use if needed */
          label em,
          .label em{
            display:block;
            position:absolute; left:28%;
            font-style:normal;
            font-weight:bold;
          }
          .blockLabels label em,
          .blockLabels .label em{
            position:static;
            display:inline;
          }

          /* Messages */
          .uniForm #errorMsg{
            background:#ffdfdf url(/theme/images/uf_error.png);
            border:1px solid #df7d7d; border-width:1px 0;
            margin:0 0 1em 0; padding:1em;
          }
          .uniForm .error,
          .uniForm .blockLabels.ctrlHolder.error{
            background:#ffdfdf url(/theme/images/uf_error.png);
            border:1px solid #df7d7d; border-width:1px 0;
            position:relative;
          }
            .uniForm #errorMsg dt,
            .uniForm #errorMsg h3{
              margin:0 0 .5em 0;
              font-size:110%;
              line-height:100%;
              font-weight:bold;
              color:#000;
              padding:2px 0 2px 18px;
              background:url(/theme/images/icon-error.png) 0 0 no-repeat;
            }
            .uniForm #errorMsg dd{
              margin:0; padding:0;
            }
              .uniForm #errorMsg ol{
                margin:0; padding:0;
              }
                .uniForm #errorMsg ol li{
                  margin:0; padding:2px;
                  list-style-position:inside;
                  border-bottom:1px dotted #df7d7d;
                  position:relative;
                }
              .uniForm .errorField{
                margin:0 0 3px 0;
              }
              .uniForm .inlineLabels .errorField{
                margin-left:30%;
              }
                .uniForm .errorField strong{
                  background:#FFE2E2;
                  padding:1px 3px 3px 3px;
                  }
             .ctrlHolder.error input,
             .ctrlHolder.error input:focus{
               border-color:#DF7D7D;
             }
             .ctrlHolder.error.focused{
               padding:7px 4px;
             }