Error: 001
Unable to load DB Connections\n";}?>

Dynamic Site

version 1.0
Developed by: J&L Information Technologies, Inc. Luis E. Gomez
"; phpinfo(); exit; } } // Global Variables INITIALIZATION define ("_DEBUG_", FALSE); define ("_USE_SLASH_", FALSE); $s_WelcomeTXT = "\nDynamic Site Administration System (DSAS)"; require_once('../lib/include.php'); $default_start_date = date ('Y-m-').'01'; $default_end_date = date ('Y-').(date ('m')+1).'-01'; //local functions function f_loc_edit($sSQLqry, $s_include, $database_name, $db_conn){ $c_functions = new db_functions (); $c_functions ->db_connect($database_name, $db_conn); $a_results = $c_functions -> get_qry_result ($sSQLqry); include ($s_include); unset ($c_functions); } function f_loc_del ($s_table, $s_where, $s_orderby, $action, $database_name, $db_conn){ $c_functions = new db_functions (); $c_functions ->db_connect($database_name, $db_conn); $s_SQL = $c_functions -> db_update ($s_table, 'D', $s_where); $c_functions -> get_qry_result ($s_SQL,3); echo "
The Information has being sucessfully REMOVED from the system
"; echo ds_display_variables ($c_functions->db_Conn, $qry_str='SELECT * FROM `'.$s_table.'` order by '.$s_orderby.';', $action); unset ($c_functions); } function f_loc_save($s_table, $s_id, $s_orderby, $action, $database_name, $db_conn){ $v_init = substr($s_table,5,1); $c_functions = new db_functions (); $c_functions ->db_connect($database_name, $db_conn); if ($s_id != ''){ echo "
The Information has being sucessfully UPDATED in the system
"; $s_SQL = $c_functions -> db_update ($s_table, 'U', $v_init."_id = ".$s_id); } else { echo "
The Information has being sucessfully ENTERED in to the system
"; $s_SQL = $c_functions -> db_update ($s_table); } $c_functions -> get_qry_result ($s_SQL,3); echo ds_display_variables ($c_functions->db_Conn, $qry_str='SELECT * FROM `'.$s_table.'` order by '.$s_orderby.';', $action); unset ($c_functions); } function f_loc_def (){ } // end local functions ?> Administration _
db_connect($database_DB_conn, $DB_conn); $a_results = $c_functions -> get_qry_result ($sSQLqry); //echo $a_results ['u_password']." -- ".ds_quick_encript ($_REQUEST['password']); if (($_REQUEST['username'] == $a_results ['u_username'])&& (ds_quick_encript ($_REQUEST['password']) == $a_results ['u_password'])&& ($_REQUEST['username'] != '')) { $_SESSION['AUTHUSER_IN'] = $a_results ['u_permission']; } else { if (isset ($_REQUEST['Submit']))echo " 
Wrong User Name or Password
Please Re-Enter your password
 "; }// else header("location: index.php?action=LGI&b_FAIL=FALSE"); } } else if ($_REQUEST['action'] == 'LGO') { unset($_SESSION['AUTHUSER_IN']); include ("lib/login_frm.php");echo " "; exit(); //header("location: index.php?action=0"); } if (!(isset ($_SESSION['AUTHUSER_IN']))) { $_SESSION['AUTHUSER_IN'] = NULL;} switch ($_SESSION['AUTHUSER_IN']){ case 'ADM': echo '
'; break; case 'USR': echo '
'; break; default: echo " "; include ("lib/login_frm.php");echo " "; exit(); break; } if (!(isset ($_REQUEST['funct']))) $_REQUEST['funct'] = NULL; switch ($_REQUEST['action']){ case "GSM": echo "
".$s_WelcomeTXT."
General Settings Maintenance\n
"; switch ($_REQUEST['funct']){ case "NEW": $a_results = array ("o_id" => NULL, "o_name"=> '', "o_values"=>''); include ("lib/options_frm.php"); break; case "EDT": $sSQL = "SELECT o_id, o_name, o_values FROM site_options WHERE o_id=".$_REQUEST['id'].";"; f_loc_edit($sSQL, "lib/options_frm.php",$database_DB_conn, $DB_conn); break; case "DEL": f_loc_del ('site_options', "o_id = ".$_REQUEST['id'], 'o_name', $_REQUEST['action'], $database_DB_conn, $DB_conn); break; case "SVE": f_loc_save('site_options', $_REQUEST['db_o_id'], "o_name", $_REQUEST['action'], $database_DB_conn, $DB_conn); break; default: $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ds_display_variables ($c_functions->db_Conn, $qry_str='SELECT o_id, o_name, o_values FROM `site_options` order by o_name;', $_REQUEST['action']); unset ($c_functions); break; } break; case "TPM": echo "
".$s_WelcomeTXT."
Templates Maintenance\n
"; switch ($_REQUEST['funct']){ case "NEW": $a_results = array ("t_id" => NULL, "t_name"=> '', "t_keywords"=> '', "t_header"=> '', "t_title"=> '', "t_template"=> '', "t_description"=> '', "t_menu"=> '', "t_loadfile"=>'NO'); include ("lib/templates_frm.php"); break; case "EDT": $sSQL = "SELECT t_id, t_name, t_keywords, t_header, t_title, t_template, t_description, t_menu, t_loadfile FROM site_templates WHERE t_id=".$_REQUEST['id'].";"; f_loc_edit($sSQL, "lib/templates_frm.php",$database_DB_conn, $DB_conn); break; case "DEL": f_loc_del ('site_templates', "t_id = ".$_REQUEST['id'], 't_name', $_REQUEST['action'], $database_DB_conn, $DB_conn); break; case "SVE": f_loc_save('site_templates', $_REQUEST['db_t_id'], "t_name", $_REQUEST['action'], $database_DB_conn, $DB_conn); break; default: $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ds_display_variables ($c_functions->db_Conn, $qry_str='SELECT t_id, t_name, t_description FROM `site_templates` order by t_name;', $_REQUEST['action']); unset ($c_functions); break; } break; case "USM": echo "
".$s_WelcomeTXT."
Users Maintenance\n
"; switch ($_REQUEST['funct']){ case "NEW": $a_results = array ("u_id" => NULL, "u_name"=> '', "u_username"=>'', "u_password"=>'', "u_lname"=>'', "u_email"=>'', "u_phone"=>'', "u_permission"=>'USR'); include ("lib/users_frm.php"); break; case "EDT": $sSQL = "SELECT * FROM site_users WHERE u_id=".$_REQUEST['id'].";"; f_loc_edit($sSQL, "lib/users_frm.php",$database_DB_conn, $DB_conn); break; case "SVE": $_REQUEST['db_u_password'] = ds_quick_encript ($_REQUEST['db_u_password']); f_loc_save('site_users', $_REQUEST['db_u_id'], "u_name", $_REQUEST['action'], $database_DB_conn, $DB_conn); break; case "DEL": f_loc_del ('site_users', "u_id = ".$_REQUEST['id'], 'u_name', $_REQUEST['action'], $database_DB_conn, $DB_conn); break; default: $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ds_display_variables ($c_functions->db_Conn, $qry_str='SELECT u_id, u_username, u_name, u_lname FROM `site_users` order by u_name;', $_REQUEST['action']); unset ($c_functions); break; } break; case "STD": switch ($_REQUEST['funct']){ case "LEAD": echo "
".$s_WelcomeTXT."
Stored Web Leads\n
"; switch ($_REQUEST['subfunct']){ case "SHW": $c_template = new template(); $c_template->db_connect($database_DB_conn, $DB_conn); $a_show = $c_template->get_all ("site_leads", "id", "id = ".$_REQUEST['id']); echo "Return to Web Leads
 "; include ("lib/display_lead_frm.php"); echo "Total of Leads on the Database :"; echo $display_form; break; case "DEL": $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); $s_SQL = $c_functions -> db_update ("site_leads", 'D', "id = ".$_REQUEST['id']); $c_functions -> get_qry_result ($s_SQL,3); echo "
The Information has being sucessfully REMOVED from the system
"; /*echo ds_display_csearch ('LEAD', '0', 'STD'); $sDefSQL = "SELECT * FROM `site_leads` WHERE ts > '".$default_start_date."' AND ts < '".$default_end_date."' "; echo ds_display_data ($c_functions->db_Conn, $sDefSQL,'STD&funct=LEAD'); unset ($c_functions); break; */ default: $sTotalQRY = "SELECT * FROM `site_leads`"; mysql_select_db($database_DB_conn, $DB_conn); $result = mysql_query($sTotalQRY , $DB_conn) or die("Error: Indx-247
".mysql_error()); $numrows =mysql_num_rows($result); echo "
Total of Leads on the Database: ".$numrows."
"; //link index.php?action=STD&funct=LEAD&subfunct=0 $sTotalQRY = "SELECT DISTINCT DATE_FORMAT( ts, '%Y-%M') FROM `site_leads` order by ts DESC"; mysql_select_db($database_DB_conn, $DB_conn); $result = mysql_query($sTotalQRY , $DB_conn) or die("Error: Indx-248
".mysql_error()); if (isset ($_REQUEST['date'])){ list ($Y, $M) = explode ('-', $_REQUEST['date']); $todayDate = strtotime ("10 $M $Y"); $today = date('Y-F', $todayDate); $SQLdate = date('Y-m', $todayDate); echo $SQLdate; } else { $today = date("Y-F"); $SQLdate = date('Y-m'); echo $SQLdate; } while ($myrow = mysql_fetch_row($result)) { ?> db_connect($database_DB_conn, $DB_conn); // echo $s_SearchSQL."
"; $sSQL = $c_page->p_page_init ($_REQUEST['page'], $sDefSQL, 15); $sLocalLinks = $c_page->p_create_links (1, 'action=STD&funct=LEAD&subfunct=0&date='.$myrow[0], $sDefSQL); unset ($c_page); $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ""; echo "\n"; unset ($c_functions); echo " \n"; } else echo "\n\n"; } ?>
\n
Pages: $sLocalLinks
\n"; echo ds_display_data ($c_functions->db_Conn, $sSQL,'STD&funct=LEAD'); echo "
\n
\nPages: $sLocalLinks\n
 \n
\n\n
".$s_WelcomeTXT."
Stored Medical History Forms\n
"; switch ($_REQUEST['subfunct']){ case "SHW": $c_template = new template(); $c_template->db_connect($database_DB_conn, $DB_conn); $a_show = $c_template->get_all ("site_med_history", "id", "id = ".$_REQUEST['id']); //Variable Initialization! $s_local_site = ".."; foreach ($a_show as $key=>$value){ //echo $key ." --- ".$value."
"; $req_key = "db_".$key; $_REQUEST[$req_key] = $value; } list ($dob_year, $dob_month, $dob_date) = explode ('-',$a_show ['dob']); $_REQUEST['dob_year'] = $dob_year; $_REQUEST['dob_month'] = $dob_month; $_REQUEST['dob_date'] = $dob_date; echo "Return to Medical History"; include ("lib/display_med_frm.php"); echo $display_form; break; case "DEL": $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); $s_SQL = $c_functions -> db_update ("site_med_history", 'D', "id = ".$_REQUEST['id']); $c_functions -> get_qry_result ($s_SQL,3); echo "
The Information has being sucessfully REMOVED from the system
"; // echo ds_display_csearch ('MHF', '0', 'STD'); // $sDefSQL = "SELECT * FROM `site_med_history` WHERE ts > '".$default_start_date."' AND ts < '".$default_end_date."' "; // echo ds_display_data ($c_functions->db_Conn, $sDefSQL,'STD&funct=MHF'); unset ($c_functions); // break; default: /*echo ds_display_csearch ('MHF', '0', 'STD'); if (isset ($_REQUEST['y_from'])){$start_date = $_REQUEST['y_from'].'-'.$_REQUEST['m_from'].'-01'; } else $start_date = NULL; if (isset ($_REQUEST['y_to'])){ $end_date = $_REQUEST['y_to'].'-'.($_REQUEST['m_to'] +1).'-01'; } else $end_date = NULL; // Debug echo "
".$default_start_date." - ".$default_end_date; if (!(isset ($start_date))) $start_date = $default_start_date; if (!(isset ($end_date))) $end_date = $default_end_date; echo "Data Displayed from: ".$start_date." (yyyy/mmm/dd) to: ".$end_date." (yyyy/mmm/dd)
"; $sDefSQL = "SELECT * FROM `site_med_history` WHERE ts > '".$start_date."' AND ts < '".$end_date."' "; // Debug echo $sDefSQL ; $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ds_display_data ($c_functions->db_Conn, $sDefSQL,'STD&funct=MHF'); unset ($c_functions);*/ $sTotalQRY = "SELECT * FROM `site_med_history`"; mysql_select_db($database_DB_conn, $DB_conn); $result = mysql_query($sTotalQRY , $DB_conn) or die("Error: Indx-355
".mysql_error()); $numrows =mysql_num_rows($result); echo "
Total Medical Histories on the Database: ".$numrows."
"; //link index.php?action=STD&funct=LEAD&subfunct=0 $sTotalQRY = "SELECT DISTINCT DATE_FORMAT( ts, '%Y-%M') FROM `site_med_history` order by ts DESC"; mysql_select_db($database_DB_conn, $DB_conn); $result = mysql_query($sTotalQRY , $DB_conn) or die("Error: Indx-361
".mysql_error()); if (isset ($_REQUEST['date'])){ list ($Y, $M) = explode ('-', $_REQUEST['date']); $todayDate = strtotime ("10 $M $Y"); $today = date('Y-F', $todayDate); $SQLdate = date('Y-m', $todayDate); } else { $today = date("Y-F"); $SQLdate = date('Y-m'); } //echo $todayDate."--".$SQLdate."$Y, $M"; echo " new time: ".strtotime ("10 $M $Y"); while ($myrow = mysql_fetch_row($result)) { ?> '".$start_date."' AND ts < '".$end_date."' ORDER BY id"; // Debug echo $sDefSQL ; //paging $c_page = new paging(); $c_page->db_connect($database_DB_conn, $DB_conn); // echo $s_SearchSQL."
"; $sSQL = $c_page->p_page_init ($_REQUEST['page'], $sDefSQL, 15); $sLocalLinks = $c_page->p_create_links (1, 'action=STD&funct=MHF&subfunct=0&date='.$myrow[0], $sDefSQL); unset ($c_page); $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ""; echo "\n"; unset ($c_functions); echo " \n"; } else echo "\n\n"; } ?>
\n
Pages: $sLocalLinks
\n"; echo ds_display_data ($c_functions->db_Conn, $sSQL,'STD&funct=MHF'); echo "
\n
\nPages: $sLocalLinks\n
 \n
\n\n
'".$start_date."' AND ts < '".$end_date."' ORDER BY id"; // Debug echo $sDefSQL ; /*$c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ds_display_data ($c_functions->db_Conn, $sDefSQL,'STD&funct=LEAD'); unset ($c_functions); $sTotalQRY = "SELECT * FROM `site_leads`"; mysql_select_db($database_DB_conn, $DB_conn); $result = mysql_query($sTotalQRY , $DB_conn) or die("Error: Indx-247
".mysql_error()); $numrows =mysql_num_rows($result); echo "
Total of Leads on the Database: ".$numrows."
"; echo ds_display_csearch ('LEAD', '0', 'STD'); if (isset ($_REQUEST['y_from'])){$start_date = $_REQUEST['y_from'].'-'.$_REQUEST['m_from'].'-01'; } else $start_date = NULL; if (isset ($_REQUEST['y_to'])){ $end_date = $_REQUEST['y_to'].'-'.($_REQUEST['m_to'] +1).'-01'; } else $end_date = NULL; // Debug echo "
".$default_start_date." - ".$default_end_date; if (!(isset ($start_date))) $start_date = $default_start_date; if (!(isset ($end_date))) $end_date = $default_end_date; echo "Data Displayed from: ".$start_date." (yyyy/mmm/dd) to: ".$end_date." (yyyy/mmm/dd)
"; $sDefSQL = "SELECT * FROM `site_leads` WHERE ts > '".$start_date."' AND ts < '".$end_date."' ORDER BY id"; // Debug echo $sDefSQL ; $c_functions = new db_functions (); $c_functions ->db_connect($database_DB_conn, $DB_conn); echo ds_display_data ($c_functions->db_Conn, $sDefSQL,'STD&funct=LEAD'); unset ($c_functions); */ break; } break; default: echo "
".$s_WelcomeTXT."
Stored Data\n
"; echo "
"; //echo ''; echo '
'; echo "
"; break; } break; default: echo "
Welcome to
".$s_WelcomeTXT."\n
"; break; } ?>