Esempio n. 1
0
 function add($item, $position = '')
 {
     if (is_array($item)) {
         foreach ($item as $i) {
             add($i);
         }
         return;
     }
     $item = trim($item);
     $ext = substr($item, -3, 3);
     $prefix = substr($item, 0, 4);
     if (substr($item, 0, 1) == '<') {
         add_header($item);
         return TRUE;
     } else {
         if ($ext == 'css') {
             add_css($item, $position);
             return TRUE;
         } else {
             if ($ext == '.js') {
                 add_js($item);
                 return TRUE;
             } else {
                 if (in_array($prefix, array('dojo', 'diji'))) {
                     add_dojo($item);
                     return TRUE;
                 } else {
                     echo log_message('error', 'add function: unknown resource ' . $item);
                     return FALSE;
                 }
             }
         }
     }
 }
Esempio n. 2
0
<?php

/*
Plugin Name: ClipBucket Modules
Description: Social Bookmarks and Recently Viewed Videos - Classic ClipBucet Modules
Author: Arslan Hassan
Author Website: http://clip-bucket.com/
ClipBucket Version: 2.1
Version: 2
Website: http://labguru.com/
Plugin Type: global
*/
if (!function_exists('cb_modules')) {
    function cb_modules()
    {
    }
    function show_social_bookmarks($vdetails = NULL)
    {
        echo "<span  class='st_stumbleupon_vcount' displayText='Stumble' style='font-size:10px'></span><span  class='st_twitter_vcount' displayText='Tweet'></span><span  class='st_facebook_vcount' displayText='Facebook'></span><span  class='st_plusone_vcount' ></span>";
        echo '<div style="height:10px"></div>';
    }
    register_anchor_function("show_social_bookmarks", "video_bookmarks");
    add_header(PLUG_DIR . '/' . this_plugin() . '/css.html');
}
<?php

session_start();
require_once '../function/data_holder.php';
require_once '../includes/output.html.php';
require_once '../database/connection.php';
$conn = connection();
add_header("Show TodoList");
if (!$conn) {
    echo "Could not establish connection to database.";
    exit;
}
if (isset($_SESSION['valid_user'])) {
    $sql = " SELECT email, active FROM users WHERE email = '" . $_SESSION['valid_user'] . "'";
    $result = $conn->query($sql);
    if (!$result) {
        echo "connection to the database couldn't be establish";
        exit;
    }
    while ($row = $result->fetch_assoc()) {
        extract($row);
        if ($active == 0) {
            user_active();
            break;
        }
    }
    $user = $_GET['user'];
    $list_id = $_GET['list_id'];
    $update = "update TodoLists set item_id = '" . $list_id . "' where t_id='" . $list_id . "' ";
    $set_id = $conn->query($update);
    if (!$set_id) {
<?php

session_start();
//error_reporting(0);
require_once '../function/data_holder.php';
require_once '../includes/output.html.php';
require_once '../database/connection.php';
$conn = connection();
add_header("New Item");
if (!$conn) {
    echo "Could not establish connection to database.";
    exit;
}
if (isset($_SESSION['valid_user'])) {
    $sql = " SELECT email, active FROM users WHERE email = '" . $_SESSION['valid_user'] . "'";
    $result = $conn->query($sql);
    if (!$result) {
        echo "connection to the database couldn't be establish";
        exit;
    }
    while ($row = $result->fetch_assoc()) {
        extract($row);
        if ($active == 0) {
            user_active();
            break;
        }
    }
    @($user = addslashes($_GET['user']));
    @($list_id = addslashes($_GET['list_id']));
    @($description = addslashes($_GET['description']));
    @($date = date("m-d-Y"));
            $responder = $sep = "";
            if (array_key_exists('frm_responder', $_POST)) {
                for ($i = 0; $i < count($_POST['frm_responder']); $i++) {
                    $responder .= $sep . $_POST['frm_responder'][$i];
                    // space separator for multiple responders
                    $sep = " ";
                }
            }
            $frm_meridiem_asof = array_key_exists('frm_meridiem_asof', $_POST) ? $_POST[frm_meridiem_asof] : "";
            $frm_asof = "{$_POST['frm_year_asof']}-{$_POST['frm_month_asof']}-{$_POST['frm_day_asof']} {$_POST['frm_hour_asof']}:{$_POST['frm_minute_asof']}:00{$frm_meridiem_asof}";
            $result = mysql_query("UPDATE `{$GLOBALS['mysql_prefix']}action` SET `description`='{$_POST['frm_description']}', `responder` = '{$responder}', `updated` = '{$frm_asof}' WHERE `id`='{$_GET['id']}' LIMIT 1") or do_error('action_w.php::update action', 'mysql_query', mysql_error(), basename(__FILE__), __LINE__);
            $result = mysql_query("UPDATE `{$GLOBALS['mysql_prefix']}ticket` SET `updated` =\t'{$frm_asof}' WHERE id='{$_GET['ticket_id']}' LIMIT 1") or do_error('action_w.php::update action', 'mysql_query', mysql_error(), basename(__FILE__), __LINE__);
            $result = mysql_query("SELECT ticket_id FROM `{$GLOBALS['mysql_prefix']}action` WHERE `id`='{$_GET['id']}' LIMIT 1") or do_error('action_w.php::update action', 'mysql_query', mysql_error(), basename(__FILE__), __LINE__);
            $row = stripslashes_deep(mysql_fetch_array($result));
            print '<BR /><BR /><FONT CLASS="header">Action updated</FONT><BR /><BR />';
            add_header($_GET['ticket_id']);
            show_ticket($row['ticket_id']);
        } else {
            if ($get_action == 'edit') {
                //get and show action to update
                $query = "SELECT * FROM `{$GLOBALS['mysql_prefix']}action` WHERE `id`='{$_GET['id']}' LIMIT 1";
                $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__);
                $row = stripslashes_deep(mysql_fetch_array($result));
                $responders = explode(" ", $row['responder']);
                // to array
                //		dump (__LINE__);
                //		dump ($responders);
                $do_yr_asof = true;
                ?>
		<SPAN STYLE='margin-left:83px;'><FONT CLASS="header">Edit Action</FONT></SPAN><BR /><BR />
		<FORM METHOD="post" NAME='ed_frm' ACTION="action_w.php?id=<?php 
<?php

require_once '../includes/output.html.php';
add_header("Help");
$keywords = "Mobile TodoList";
$description = "Mobile TodoList help section";
?>

<div class ="container">
	<div class="row">
	   <div class="wrapper">
		   <div class="col-md-4" >
		   	<?php 
menu();
?>
		   </div>
		   <div class="col-md-8 top">
		   	<div class="page-header">
              <h1>Help </h1>
           </div><!--Page Header-->
           <div class="well well-lg" id="hero">
           	    <ul>
           	    	<li><a name="choice" onclick="show_help(a); return false;">Saving TodoLists</a></li>
           	    	<li><a name="choice" onclick="show_help(b); return false;">Account Settings</a></li>
           	    	<li><a name="choice" onclick="show_help(c); return false;">Change Password</a></li>
           	    	<li><a name="choice" onclick="show_help(d); return false;">Stop Email reminders</a></li>
           	    	<li><a name="choice" onclick="show_help(f); return false;">Reporting Errors</a></li>

           	    </ul>

           </div><!--well -->
 $id_stack = array_unique($id_stack);
 // at least one
 $in_str = $sep = "";
 for ($i = 0; $i < count($id_stack); $i++) {
     $in_str .= "{$sep}'{$id_stack[$i]}'";
     $sep = ", ";
 }
 $query = "SELECT `id`, UNIX_TIMESTAMP(`problemstart`) AS `problemstart`, UNIX_TIMESTAMP(`updated`) AS `updated`, `scope`, `status`, `severity`,\n\t\t\t\tCONCAT_WS(' ',`street`,`city`,`state`) AS `addr`\n\t\t\t\tFROM `{$GLOBALS['mysql_prefix']}ticket` \n\t\t\t\tWHERE `status` <> {$GLOBALS['STATUS_RESERVED']} \n\t\t\t\tAND `id` IN ({$in_str})\n\t\t\t\tAND `status` LIKE " . quote_smart($_POST['frm_querytype']) . "\n\t\t\t\tORDER BY `severity` DESC, `problemstart` ASC";
 //		dump ($query);
 $result = mysql_query($query) or do_error($query, '', mysql_error(), basename(__FILE__), __LINE__);
 // ___________________________________  END NEW STUFF __________________
 //			dump(mysql_num_rows($result));
 if (mysql_num_rows($result) == 1) {
     // display ticket in whole if just one returned
     $row = stripslashes_deep(mysql_fetch_assoc($result));
     add_header($row['id']);
     show_ticket($row['id'], FALSE, $_POST['frm_query']);
     // include search term for highlighting
     exit;
 } elseif (mysql_num_rows($result) == 0) {
     print "<SPAN STYLE = 'margin-left:80px'><B>No matches found</B></SPAN><BR /><BR />";
 } else {
     //  more than one, list them
     print "<SPAN STYLE = 'margin-left:80px'><B>Matches</B>: tickets {$tick_hits}, actions {$act_hits}, persons {$per_hits}</SPAN><BR /><BR />";
     print "<TABLE BORDER='0'><TR CLASS='even'>\n\t\t\t\t\t<TD CLASS='td_header'><SPAN STYLE = 'margin-left:2px;'>Ticket</SPAN></TD>\n\t\t\t\t\t<TD CLASS='td_header'><SPAN STYLE = 'margin-left:20px;'>Opened</SPAN></TD>\n\t\t\t\t\t<TD CLASS='td_header'><SPAN STYLE = 'margin-left:20px;'>Description</SPAN></TD>\n\t\t\t\t\t<TD CLASS='td_header'><SPAN STYLE = 'margin-left:20px;'>Location</SPAN></TD></TR>";
     $counter = 0;
     while ($row = stripslashes_deep(mysql_fetch_assoc($result))) {
         // 8/28/08
         if ($row['status'] == $GLOBALS['STATUS_CLOSED']) {
             $strike = "<strike>";
             $strikend = "</strike>";
<?php

require_once 'includes/output.html.php';
add_header("Login");
?>

<div id = "content">

<div class="container">
<div class="row">

<div class="col-lg-6 col-md-7 col-sm-9" style="margin-left:22%;">

  <h4 style="border-bottom: 1px solid #c5c5c5;">
    <i class="glyphicon glyphicon-user">
    </i>
    Account Access
  </h4>
  <div style="padding: 20px;" id="form-olvidado">
  <form accept-charset="UTF-8" role="form" id="login-form" method="post" action="login_fns.php">
    <h4 class="">
      Signin!
    </h4>
      <fieldset>
        <div class="form-group input-group">
          <span class="input-group-addon">
            @
          </span>
          <input class="form-control" placeholder="Email" name="email" type="email"  autofocus="" required>
        </div>
        <div class="form-group input-group">
<?php

require_once '../includes/output.html.php';
add_header("Contact");
$keywords = "TodoLists creator, Games , News information ";
$description = "Contact Time-Box Application ";
?>
<div class="container">

<div class="row">
<div class="wrapper">
	   <div class="col-md-8">
         <h1 id="header">Web Developer</h1>
	  
	   	  <form method="post" action="send_mail.php" id="form_contact" >
	        
	        <input type="text" name="first_name" placeholder="First Name" />
	        <input type="text" name="last_name" placeholder="Last Name" />
	        <input type= "email" name ="email" placeholder="Email Address" />
             <textarea name="comment" id="message" placeholder="Message" /></textarea>
             <input type="submit" name="submit" value="Contact Me"  />
	      
         </form>
             <div id="notice"></div>
	 </div>
	 <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
	 	 <div class="sidebar-module sidebar-module-inset">
            <h4><a rel="preload" href="http://time-box/About/">About</a></h4><hr style="border:thin solid #ccc;"/>
            <p>Emmanuel Alcime<br/>
       
        Phone:(242)-449-8298<br/>
<?php

error_reporting(0);
// include function files for this application
require_once 'includes/output.html.php';
session_start();
$old_user = $_SESSION['valid_user'];
// store to test if they *were* logged in
unset($_SESSION['valid_user']);
$result_dest = session_destroy();
// start output html
add_header('Logged Out');
if (!empty($old_user)) {
    if ($result_dest) {
        // if they were logged in and are now logged out
        echo "<div class='wrapper'>";
        echo "<div class='alert alert-success'>Logged out.<br />";
        do_html_url('login.php', 'Login');
        echo "</div>";
        echo "</div>";
    } else {
        // they were logged in and could not be logged out
        echo 'Could not log you out.<br />';
    }
} else {
    // if they weren't logged in but came to this page somehow
    echo "<div class='wrapper'>";
    echo "<div class='alert alert-success'>Logged out.<br />";
    echo 'You were not logged in, and so have not been logged out.<br />';
    do_html_url('login.php', 'Login');
    echo "</div>";
<?php

require_once 'includes/output.html.php';
add_header('Change Password');
change_pass_form();
add_footer();
<?php

// start a new session
// include function files for this application
require_once 'database/connection.php';
require_once 'includes/output.html.php';
require_once 'function/data_holder.php';
//get new database connection
$conn = connection();
add_header("Verify Account");
?>


<!-- start header div --> 
<div class="container">
	<div class="row">

    
    <!-- start wrap div -->   
    <div id="wrapper">
        <!-- start PHP code -->
     
        <div class="page-header" style='margin-left:11%;'>
        	<h3>Time Box Signup</h3>
       </div>

    <!-- end header div -->   
     
<?php 
if (isset($_GET['email']) && !empty($_GET['email']) and isset($_GET['hash']) && !empty($_GET['hash'])) {
    // Verify data
Esempio n. 13
0
// this is the guadian api
$g_key = "http://content.guardianapis.com/search?show-elements=image&api-key=agu5esashhuk6yqngrwj4yt6";
$json_url = "http://freegeoip.net/json";
if (!$json_url) {
    print "unable to find file for open ";
} else {
    @($link = file_get_contents($json_url));
    $place = json_decode($link, true);
    $city = $place['city'];
    $lat = $place['latitude'];
    $long = $place['longitude'];
    $country = $place['country_name'];
    $time_zone = $place['time_zone'];
}
$ip = $place['ip'];
add_header("Welcome To Boite");
?>
<div id ="content">
	<div id="main_page">
		   
		   <div class="wrapper" style=" margin-right:13%;">
		   <h1 class="heading">Welcome 
		   <?php 
if ($country) {
    echo escape($country);
} else {
    echo "To Boite";
}
?>
		   </h1>
              <?php 
<?php

session_start();
require_once '../function/data_holder.php';
require_once '../database/connection.php';
require_once '../includes/output.html.php';
$con = connection();
add_header("Profile - Add User Information ");
?>
<div class="container">
<div class="wrapper" style="margin-left:10%;">
	<div class="row">
		    <div class="col-md-8">
		    <div class="page-header">
                   <h1 style=" font-size:160%; letter-spacing:2px;"> Step 2 / <small><?php 
echo escape($_SESSION['valid_user']);
?>
</small></h1>
            </div><!-- PAGE HEADER -->
            <p>Adding User Information. </p>


             <div id ="show_buttons">
             	<div id ="user_image">
             		
             	<?php 
echo "<div class='img-rounded' id='image'><?php echo " . $_SESSION['user_image'] . ";?></div>\n                         <div id ='username'><?php echo" . $_SESSION['email'] . ";?></div>";
?>
             	</div>
             </div>
             <div id="show_form">
Esempio n. 15
0
    ?>
; z-index:5001; cursor: pointer;" onclick="showDiv('region_boxes', 'collapse_regs', 'expand_regs');"><IMG SRC = "./markers/expand.png" ALIGN="right"></SPAN></div>
	<div class="bar" STYLE="color:red; z-index: 5000;"
       onmousedown="dragStart(event, 'boxB')"><i>Drag me</i></div>
	<div 
  <div id="region_boxes" class="content" style="z-index: 5000;"></div>
</div>
</div>
<?php 
}
if ($get_print) {
    show_ticket($get_id, 'true');
    print "<BR /><P ALIGN='left'>";
} else {
    if ($get_id) {
        add_header($get_id);
        show_ticket($get_id);
        print "<BR /><P ALIGN='left'>";
    } else {
        if ($get_sort_by_field && $get_sort_value) {
            list_tickets($get_sort_by_field, $get_sort_value);
        } else {
            list_tickets();
        }
    }
}
?>
<FORM NAME='to_closed' METHOD='get' ACTION = '<?php 
print basename(__FILE__);
?>
'> <!-- 11/28/10 not now used - replaced with form to_listtype -->
Esempio n. 16
0
<?php

require_once '../includes/output.html.php';
add_header("About");
$keywords = "Mobile TodoList application";
$description = "Mobile TodoList application for planning your schedule with email reminders";
?>
<div class="container">
   <div class='row'>
      <div class='wrapper'>
      <div class="page-header">
        <h1>Time-Box</h1>
        <p class="lead"> Mobile And Desktop Appliction For Common Task <a href="http://time-box.tk/">Browse Applications</a> for more information.</p>
      </div>

      <h3>Future changes</h3>
      <p>Note the lack of the of  more gaming content  for users might find  which I plan to add more gaming content for s better user experience  </p>

      <h3>Regarding TodoList And Reminders</h3>
      <p>Every <a  href="http://time-box/todo_lists/">TodoList</a> created.The users recieve an email reminder of the the item or event and the user create.</p>

      <h3>Web Browsers</h3>
      <p>This site is suitable for all  web broswers and fit's on all size screens but, for the best user experince use Firefox or Google Chrome while using desktop browsers</p>
 </div><!--wrapper-->     
 </div><!--row-->
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
   
<?php

session_start();
require_once '../function/data_holder.php';
require_once '../database/connection.php';
require_once '../includes/output.html.php';
$con = connection();
add_header("Profile");
if (isset($_SESSION['valid_user'])) {
    $find_user_and_id = "SELECT * FROM users WHERE email = '" . $_SESSION['valid_user'] . "' LIMIT 1";
    $result = $con->query($find_user_and_id);
    if (!$result) {
        echo " An Error occurred !";
    } else {
        while ($row = $result->fetch_assoc()) {
            session_regenerate_id();
            $_SESSION['id'] = $row['user_id'];
            $_SESSION['username'] = $row['username'];
            $_SESSION['email'] = $row['email'];
            $_SESSION['country'] = $row['country'];
            $_SESSION['profile_id'] = $row['profile_id'];
        }
        // while statement.
    }
    ?>

<div class="container">
   <div class="row">
     <div class="wrapper">
      <div class="col-md-6">
              <h2>Creating Your User Profile/ &nbsp;<?php 
Esempio n. 18
0
Plugin Type: global
*/
include "recaptchalib.php";
// Get a key from https://www.google.com/recaptcha/admin/create
$publickey = $Cbucket->configs['reCaptcha_public_key'];
$privatekey = $Cbucket->configs['reCaptcha_private_key'];
# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;
function cbRecaptcha()
{
    global $publickey, $privatekey, $error;
    return recaptcha_get_html($publickey, $error);
}
function validateCbRecaptcha($val = NULL)
{
    global $privatekey;
    if ($_POST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if ($resp->is_valid) {
            return true;
        } else {
            return false;
        }
    }
}
register_cb_captcha('cbRecaptcha', 'validateCbRecaptcha', false);
register_anchor('; Recaptcha.reload ();', 'onClickAddComment');
add_header(PLUG_DIR . '/recaptcha/reCaptcha_header.html');
Esempio n. 19
0
function edit_ticket($id)
{
    /* post changes */
    global $addrs, $NOTIFY_TICKET;
    $post_frm_meridiem_problemstart = empty($_POST) || !empty($_POST) && empty($_POST['frm_meridiem_problemstart']) ? "" : $_POST['frm_meridiem_problemstart'];
    $post_frm_meridiem_booked_date = empty($_POST) || !empty($_POST) && empty($_POST['frm_meridiem_booked_date']) ? "" : $_POST['frm_meridiem_booked_date'];
    //10/1/09
    $post_frm_affected = empty($_POST) || !empty($_POST) && empty($_POST['frm_affected']) ? "" : $_POST['frm_affected'];
    $_POST['frm_description'] = strip_html($_POST['frm_description']);
    //clean up HTML tags
    $post_frm_affected = strip_html($post_frm_affected);
    $_POST['frm_scope'] = strip_html($_POST['frm_scope']);
    /*		if (get_variable('reporting')) {		// if any change do automatic action reporting
    		
    //			if ($_POST[frm_affected] != $_POST[frm_affected_default]) report_action($GLOBALS[ACTION_AFFECTED],$_POST[frm_affected],0,$id);
    			if ($_POST[frm_severity] != $_POST[frm_severity_default]) report_action($GLOBALS[ACTION_SEVERITY],get_severity($_POST[frm_severity_default]),get_severity($_POST[frm_severity]),$id);
    			if ($_POST[frm_scope] != $_POST[frm_scope_default]) report_action($GLOBALS[ACTION_SCOPE],$_POST[frm_scope_default],0,$id);
    			} 
    */
    if (!get_variable('military_time')) {
        //put together date from the dropdown box and textbox values
        if ($post_frm_meridiem_problemstart == 'pm') {
            $post_frm_meridiem_problemstart = ($post_frm_meridiem_problemstart + 12) % 24;
        }
        if (isset($_POST['frm_meridiem_booked_date'])) {
            //10/1/09
            if ($_POST['frm_meridiem_booked_date'] == 'pm') {
                $_POST['frm_hour_booked_date'] = ($_POST['frm_hour_booked_date'] + 12) % 24;
            }
        }
        //			if ($_POST['frm_meridiem_problemend'] == 'pm') 	$_POST['frm_hour_problemend'] 	= ($_POST['frm_hour_problemend'] + 12) % 24;
    }
    if (empty($post_frm_owner)) {
        $post_frm_owner = 0;
    }
    //		$frm_problemstart = $_POST['frm_year_problemstart']-$_POST['frm_month_problemstart']-$_POST['frm_day_problemstart'] $_POST['frm_hour_problemstart']:$_POST['frm_minute_problemstart']:00";
    $frm_problemstart = "{$_POST['frm_year_problemstart']}-{$_POST['frm_month_problemstart']}-{$_POST['frm_day_problemstart']} {$_POST['frm_hour_problemstart']}:{$_POST['frm_minute_problemstart']}:00{$post_frm_meridiem_problemstart}";
    $curr_groups = $_POST['frm_exist_groups'];
    //	6/10/11
    $groups = "," . implode(',', $_POST['frm_group']) . ",";
    //	6/10/11
    //		dump($_POST); 	//	6/10/11
    if (!get_variable('military_time')) {
        //put together date from the dropdown box and textbox values
        if ($post_frm_meridiem_problemstart == 'pm') {
            $_POST['frm_hour_problemstart'] = ($_POST['frm_hour_problemstart'] + 12) % 24;
        }
        if (isset($_POST['frm_meridiem_problemend'])) {
            if ($_POST['frm_meridiem_problemend'] == 'pm') {
                $_POST['frm_hour_problemend'] = ($_POST['frm_hour_problemend'] + 12) % 24;
            }
        }
        if (isset($_POST['frm_meridiem_booked_date'])) {
            //10/1/09
            if ($_POST['frm_meridiem_booked_date'] == 'pm') {
                $_POST['frm_hour_booked_date'] = ($_POST['frm_hour_booked_date'] + 12) % 24;
            }
        }
    }
    $frm_problemend = isset($_POST['frm_year_problemend']) ? quote_smart("{$_POST['frm_year_problemend']}-{$_POST['frm_month_problemend']}-{$_POST['frm_day_problemend']} {$_POST['frm_hour_problemend']}:{$_POST['frm_minute_problemend']}:00") : "NULL";
    $frm_booked_date = isset($_POST['frm_year_booked_date']) ? quote_smart("{$_POST['frm_year_booked_date']}-{$_POST['frm_month_booked_date']}-{$_POST['frm_day_booked_date']} {$_POST['frm_hour_booked_date']}:{$_POST['frm_minute_booked_date']}:00") : "NULL";
    //10/1/09
    if ($_POST['frm_status'] != 1) {
        $frm_problemend = "NULL";
    }
    // perform db update
    $now = mysql_format_date(time() - get_variable('delta_mins') * 60);
    $by = $_SESSION['user_id'];
    // 12/7/10
    if (empty($post_frm_owner)) {
        $post_frm_owner = 0;
    }
    // 8/23/08, 9/20/08, 9/22/09 (Facility), 10/1/09 (receiving facility), 6/26/10 (911), 6/10/11
    $query = "UPDATE `{$GLOBALS['mysql_prefix']}ticket` SET \n\t\t\t`contact`= " . quote_smart(trim($_POST['frm_contact'])) . ",\n\t\t\t`street`= " . quote_smart(trim($_POST['frm_street'])) . ",\n\t\t\t`city`= " . quote_smart(trim($_POST['frm_city'])) . ",\n\t\t\t`state`= " . quote_smart(trim($_POST['frm_state'])) . ",\n\t\t\t`phone`= " . quote_smart(trim($_POST['frm_phone'])) . ",\n\t\t\t`facility`= " . quote_smart(trim($_POST['frm_facility_id'])) . ",\n\t\t\t`rec_facility`= " . quote_smart(trim($_POST['frm_rec_facility_id'])) . ",\n\t\t\t`lat`= " . quote_smart(trim($_POST['frm_lat'])) . ",\n\t\t\t`lng`= " . quote_smart(trim($_POST['frm_lng'])) . ",\n\t\t\t`scope`= " . quote_smart(trim($_POST['frm_scope'])) . ",\n\t\t\t`owner`= " . quote_smart(trim($post_frm_owner)) . ",\n\t\t\t`severity`= " . quote_smart(trim($_POST['frm_severity'])) . ",\n\t\t\t`in_types_id`= " . quote_smart(trim($_POST['frm_in_types_id'])) . ",\n\t\t\t`status`=" . quote_smart(trim($_POST['frm_status'])) . ",\n\t\t\t`problemstart`=" . quote_smart(trim($frm_problemstart)) . ",\n\t\t\t`problemend`=" . $frm_problemend . ",\n\t\t\t`description`= " . quote_smart(trim($_POST['frm_description'])) . ",\n\t\t\t`comments`= " . quote_smart(trim($_POST['frm_comments'])) . ",\n\t\t\t`nine_one_one`= " . quote_smart(trim($_POST['frm_nine_one_one'])) . ",\n\t\t\t`booked_date`= \t\t{$frm_booked_date},\n\t\t\t`_by` = \t\t\t{$by}, \n\t\t\t`updated`='{$now}'\n\t\t\tWHERE ID='{$id}'";
    $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), __FILE__, __LINE__);
    $list = $_POST['frm_exist_groups'];
    //	6/10/11
    $ex_grps = explode(',', $list);
    //	6/10/11
    if ($curr_groups != $groups) {
        //	6/10/11
        foreach ($_POST['frm_group'] as $posted_grp) {
            //	6/10/11
            if (!in_array($posted_grp, $ex_grps)) {
                $tick_stat = $_POST['frm_status'];
                $query = "INSERT INTO `{$GLOBALS['mysql_prefix']}allocates` (`group` , `type`, `al_as_of` , `al_status` , `resource_id` , `sys_comments` , `user_id`) VALUES \n\t\t\t\t\t\t\t({$posted_grp}, 1, '{$now}', {$tick_stat}, {$id}, 'Allocated to Group' , {$by})";
                $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
            }
        }
        foreach ($ex_grps as $existing_grp) {
            //	6/10/11
            print $existing_grp;
            if (in_array($existing_grp, get_allocates(4, $id))) {
                if (!in_array($existing_grp, $_POST['frm_group'])) {
                    $query = "DELETE FROM `{$GLOBALS['mysql_prefix']}allocates` WHERE `type` = 1 AND `group` = '{$existing_grp}' AND `resource_id` = {$id}";
                    $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
                }
            }
        }
    }
    $query = "SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` WHERE `ticket_id` = '{$id}' AND (`clear` IS NULL OR DATE_FORMAT(`clear`,'%y') = '00')";
    $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    $num_assigns = mysql_num_rows($result);
    if ($num_assigns != 0) {
        //	4/4/11 - added to update any existing assigns record with any ticket changes.
        $query = "UPDATE `{$GLOBALS['mysql_prefix']}assigns` SET \n\t\t\t`as_of`='{$now}',\n\t\t\t`status_id`= " . quote_smart(trim($_POST['frm_status'])) . ",\n\t\t\t`user_id`= " . quote_smart(trim($post_frm_owner)) . ",\n\t\t\t`facility_id`= " . quote_smart(trim($_POST['frm_facility_id'])) . ",\n\t\t\t`rec_facility_id`= " . quote_smart(trim($_POST['frm_rec_facility_id'])) . "\n\t\t\tWHERE ticket_id='{$id}'";
        $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    }
    do_log($GLOBALS['LOG_INCIDENT_CHANGE'], $id, 0);
    // report change - 3/25/10
    if ($_POST['frm_status'] == $GLOBALS['STATUS_CLOSED']) {
        // log incident complete - repeats possible
        do_log($GLOBALS['LOG_INCIDENT_CLOSE'], $id, 0);
    }
    switch ($_POST['frm_fac_chng']) {
        // log facility changes - 3/25/10
        case "0":
            // no change
            break;
        case "1":
            do_log($GLOBALS['LOG_FACILITY_INCIDENT_CHANGE'], $id, 0);
            //10/1/09
            break;
        case "2":
            do_log($GLOBALS['LOG_CALL_REC_FAC_CHANGE'], $id);
            //10/7/09
            break;
        case "3":
            do_log($GLOBALS['LOG_FACILITY_INCIDENT_CHANGE'], $id, 0);
            //10/1/09
            do_log($GLOBALS['LOG_CALL_REC_FAC_CHANGE'], $id);
            //10/7/09
            break;
        default:
            // 8/10/09
            //			dump($_POST['frm_fac_chng']);
            print "ERROR in " . basename(__FILE__) . " " . __LINE__ . "<BR />";
    }
    // end switch ()
    print '<FONT CLASS="header">Ticket <I>' . $_POST['frm_scope'] . '</I> has been updated</FONT><BR /><BR />';
    /* show updated ticket */
    //	notify_user($id, $GLOBALS['NOTIFY_TICKET']);
    add_header($id);
    show_ticket($id);
    $addrs = notify_user($id, $GLOBALS['NOTIFY_TICKET_CHG']);
    // returns array or FALSE
    unset($_SESSION['active_ticket']);
    // 5/4/11
}
<?php

require_once 'database/connection.php';
require_once 'function/data_holder.php';
require_once 'includes/output.html.php';
add_header("Resetting password");
// creating short variable name
$username = $_POST['username'];
try {
    $password = reset_password($username);
    notify_password($username, $password);
    echo 'Your new password has been emailed to you.<br />';
} catch (Exception $e) {
    echo 'Your password could not be reset - please try again later.';
}
do_html_url('login.php', 'Login');
add_footer();
Esempio n. 21
0
END FUNCTIONS
***************/
ini_set('user_agent', '[your app name here]');
//Strava says they like it if you use a user-agent name
//PHONY USER INPUTS
//these are where your user-provided data go.
$file_type = 'GPX';
$user_url = 'http://app.strava.com/rides/13969368';
//PARSING SUBMISSIONS, ASKING FOR API DATA
$target_array = get_target($user_url);
//CHECKING THE RESPONSE FROM STRAVA
check_response($target_array[stream], $target_array[id]);
//SELECTING THE DATA I WANT
$ride_data_array = loop_setup($file_type, $target_array);
//ASSEMBLING A HEADER FOR THE APPROPRIATE FILETYPE
$header = add_header($file_type, $ride_data_array);
//GETTING DATA FOR EACH POINT ON THE STRAVA TARGET
$stream_data = api_call($target_array[id], $target_array[stream]);
//SETTING INITIAL VALUES FOR THE LOOP
$trackpoints = '';
$start_epoch = gps_to_epoch($ride_data_array[ride_date]);
if ($target_array[object] === 'segment') {
    //segments have no time stamps
    $stop_at = count($stream_data->latlng) - 1;
} else {
    //stationary rides have no coordinates
    $stop_at = count($stream_data->time) - 1;
}
//TURNING THE CRANK
for ($i = 0; $i <= $stop_at; $i++) {
    $seconds_time = $stream_data->time[$i];
<?php

session_start();
require_once '../function/data_holder.php';
require_once '../includes/output.html.php';
require_once '../database/connection.php';
require_once '../function/bog_info.php';
$conn = connection();
// database connection
error_reporting(0);
add_header("TodoLists");
?>
<div class='container'>
       <div class='row'>
         <div class='wrapper'>       
            <?php 
if (!check_valid_user()) {
    header("Location: http://time-box.tk//login.php?");
} else {
    ?>
              <?php 
    if (isset($_POST['submit'])) {
        // create short varibles
        $todo_list_name = stripslashes($_POST['TodoList_name']);
        $description = stripslashes($_POST['description']);
        $due_date = $_POST['due_date'];
        // find user todo_list_id
        try {
            $user = "******" . $_SESSION['valid_user'] . "'";
            $query = $conn->query($user);
            if ($query->num_rows) {
        }
        $subject = "Feedback from web site";
        $mailcontent = "Client first name: " . $first_name . "\n" . "Client last name:" . $last_name . "\n" . "Clinet: email " . $email . "\n" . "Client comments:\n" . $message . "\n";
        $fromaddress = "From: time-box.tk website ";
        $send = mail($toaddress, $subject, $mailcontent, $fromaddress);
        if ($send) {
            $query = "insert into contacts(first_name,last_name,email,message)values(?,?,?,?)";
            $stmt = $con->prepare($query);
            $stmt->bind_param("ssss", $first_name, $last_name, $email, $message);
            $stmt->execute();
            echo $stmt->affected_rows . ' message sent';
            $stmt->close();
            header("Location:http://www.time-box.tk");
        }
    }
} catch (Exception $e) {
    add_header("Error");
    echo "<div class='container'>";
    echo "<div class='row'>";
    echo "<div class='wrapper'>";
    echo "<div class='col-md-8'>";
    echo "<div class='alert alert-warning' role='alert' style='margin-top='10%;'>";
    echo $e->getMessage();
    echo "</div>";
    mail_form();
    echo "</div>";
    echo "</div>";
    echo "</div>";
    echo "</div>";
    add_footer();
}
Esempio n. 24
0
<?php

session_start();
require_once 'function/data_holder.php';
require_once 'includes/output.html.php';
require_once 'database/connection.php';
// get old location from user.
define("route", "http://localhost.com/ajax_loader");
$conn = connection();
add_header("Home");
if (!$conn) {
    echo "Could not establish connection to database.";
    exit;
}
if (isset($_SESSION['valid_user'])) {
    $sql = " SELECT email, active FROM users WHERE email = '" . $_SESSION['valid_user'] . "'";
    $result = $conn->query($sql);
    if (!$result) {
        echo "connection to the database couldn't be establish";
        exit;
    }
    while ($row = $result->fetch_assoc()) {
        extract($row);
        if ($active == 0) {
            user_active();
            break;
        }
    }
    if (!check_profile()) {
        create_profile();
    }
<?php

require_once 'includes/output.html.php';
add_header("register");
register_form();
add_footer();
//require_once('function/security.php');
require_once 'database/connection.php';
require_once 'includes/output.html.php';
require_once 'function/data_holder.php';
//create short variable names
$email = $_POST['email'];
$password = $_POST['password'];
if (!empty($_POST['email']) && !empty($_POST['password'])) {
    // they have just tried logging in
    try {
        login($email, $password);
        // if they are in the database register the user id
        session_start();
        $_SESSION['valid_user'] = $email;
        $cookie_name = 'login';
        setcookie($cookie_name, $email, time() + 3600, "/");
        if (!last_page()) {
            header("Location:index.php");
        }
    } catch (Exception $e) {
        // unsuccessful login
        add_header('Problem:');
        echo "<div class='wrapper' style=' position:relative; left:-200px; width:30%; height:20em; '>";
        echo '<h3 style="margin-top:20%; width:180%;">You could not be logged in. You must be logged in to view this page.</h3><br/>';
        echo "<b>Try Again!</b><br/><hr/>";
        do_html_url('login.php', 'Login');
        echo "</div>";
        add_footer();
        exit;
    }
}
function show_todolist_notice()
{
    add_header('Please Login:'******'wrapper' style=' width:30%; height:30em; '>";
       echo "<h2 style='position:relative; top:150px;'>Create a TodoList</h2>";
       echo "<div class='alert alert-danger' style='position:relative; left:05%; top:40%;'>" ;
       echo "<div style='text-align:center; font-weight:bold; text-shadow:0px 1px 1px #eee;'> Please Login To Create a TodoList </div></div><br/>"; 
       echo"<a style='display:block; position:relative; top:150px; left:6%;' href='http://localhost/ajax_loader/login.php'>Login</a>";
       echo"</div>";
  
<?php 
    add_footer();
    return true;
}