function Get_LatLng_From_Google_Maps($address)
{
    $url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&sensor=false';
    // Make the HTTP request
    $data = @file_get_contents($url);
    // Parse the json response
    $jsondata = json_decode($data, true);
    // If the json data is invalid, return empty array
    if (!check_status($jsondata)) {
        return array();
    }
    $LatLng = array('lat' => $jsondata["results"][0]["geometry"]["location"]["lat"], 'lng' => $jsondata["results"][0]["geometry"]["location"]["lng"]);
    return $LatLng;
}
function Get_Address_From_Google_Maps($lat, $lon)
{
    $url = "http://maps.googleapis.com/maps/api/geocode/json?latlng={$lat},{$lon}&sensor=false";
    // Make the HTTP request
    $data = @file_get_contents($url);
    // Parse the json response
    $jsondata = json_decode($data, true);
    // If the json data is invalid, return empty array
    if (!check_status($jsondata)) {
        return array();
    }
    $address = array('country' => google_getCountry($jsondata), 'province' => google_getProvince($jsondata), 'city' => google_getCity($jsondata), 'street' => google_getStreet($jsondata), 'postal_code' => google_getPostalCode($jsondata), 'country_code' => google_getCountryCode($jsondata), 'formatted_address' => google_getAddress($jsondata));
    return $address;
}
Example #3
0
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with eLabFTW.  If not, see <http://www.gnu.org/licenses/>.
*
********************************************************************************/
require_once 'inc/common.php';
// get $id from $_POST['id']
if (is_pos_int($_POST['id'])) {
    $id = $_POST['id'];
} else {
    die('Bad id value.');
}
// we only update status
if (isset($_POST['status'])) {
    $status = check_status($_POST['status']);
    $sql = "UPDATE experiments \n        SET status = :status \n        WHERE userid_creator = :userid \n        AND id = :id";
    $req = $bdd->prepare($sql);
    $result = $req->execute(array('status' => $status, 'userid' => $_SESSION['userid'], 'id' => $id));
    // we only update visibility
} elseif (isset($_POST['visibility'])) {
    // will return 'team' in case of wrong visibility
    $visibility = check_visibility($_POST['visibility']);
    $sql = "UPDATE experiments \n        SET visibility = :visibility \n        WHERE userid_creator = :userid \n        AND id = :id";
    $req = $bdd->prepare($sql);
    $result = $req->execute(array('visibility' => $visibility, 'userid' => $_SESSION['userid'], 'id' => $id));
    // or we update date, title, and body
} else {
    // get $title from $_POST['title']
    $title = check_title($_POST['title']);
    // get $body from $_POST['body']
        ?>
</td>
        <td><?php 
        echo check_timestamp($item['rdb_last_save_time']);
        ?>
</td>
        <td><?php 
        echo check_value($item['rdb_last_bgsave_status']);
        ?>
</td>
        <td><?php 
        echo $item['rdb_last_bgsave_time_sec'];
        ?>
</td>
        <td><?php 
        echo check_status($item['aof_enabled']);
        ?>
</td>
        <td><?php 
        if ($item['aof_enabled'] != 0) {
            echo round($item['aof_current_size'] / 1024 / 1024, 2);
        } else {
            echo "---";
        }
        ?>
</td>
        <td><?php 
        if ($item['aof_enabled'] != 0) {
            echo check_value($item['aof_last_bgrewrite_status']);
        } else {
            echo "---";
Example #5
0
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
define('PHPWG_ROOT_PATH', './');
include_once PHPWG_ROOT_PATH . 'include/common.inc.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_GUEST);
if (empty($_GET['q'])) {
    redirect(make_index_url());
}
$search = array();
$search['q'] = $_GET['q'];
$query = '
SElECT id FROM ' . SEARCH_TABLE . '
  WHERE rules = \'' . addslashes(serialize($search)) . '\'
;';
$search_id = array_from_query($query, 'id');
if (!empty($search_id)) {
    $search_id = $search_id[0];
    $query = '
UPDATE ' . SEARCH_TABLE . '
  SET last_seen=NOW()
Example #6
0
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
//----------------------------------------------------------- include
define('PHPWG_ROOT_PATH', './');
include_once PHPWG_ROOT_PATH . 'include/common.inc.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_FREE);
//----------------------------------------------------------- user registration
if (!$conf['allow_user_registration']) {
    page_forbidden('User registration closed');
}
trigger_notify('loc_begin_register');
if (isset($_POST['submit'])) {
    if (!verify_ephemeral_key(@$_POST['key'])) {
        set_status_header(403);
        $page['errors'][] = l10n('Invalid/expired form key');
    }
    if (empty($_POST['password'])) {
        $page['errors'][] = l10n('Password is missing. Please enter the password.');
    } else {
        if (empty($_POST['password_conf'])) {
            $page['errors'][] = l10n('Password confirmation is missing. Please confirm the chosen password.');
Example #7
0
    $to = check_date($_REQUEST['to']);
} else {
    $to = '';
}
if (isset($_REQUEST['tags']) && !empty($_REQUEST['tags'])) {
    $tags = filter_var($_REQUEST['tags'], FILTER_SANITIZE_STRING);
} else {
    $tags = '';
}
if (isset($_REQUEST['body']) && !empty($_REQUEST['body'])) {
    $body = check_body($_REQUEST['body']);
} else {
    $body = '';
}
if (isset($_REQUEST['status']) && !empty($_REQUEST['status'])) {
    $status = check_status($_REQUEST['status']);
} else {
    $status = '';
}
if (isset($_REQUEST['rating']) && !empty($_REQUEST['rating'])) {
    if ($_REQUEST['rating'] === 'no') {
        $rating = '0';
    } else {
        $rating = intval($_REQUEST['rating']);
    }
} else {
    $rating = '';
}
if (isset($_REQUEST['owner']) && !empty($_REQUEST['owner']) && is_pos_int($_REQUEST['owner'])) {
    $owner_search = true;
    $owner = $_REQUEST['owner'];
Example #8
0
require_once "userlogin.php";
session_start();
// IMPORTANT VARIABLES
$UserId = $_SESSION['user_id'];
$BookingDate = $_POST['bookDate'];
$TableNumber = $_POST['bookTables'];
$TimeFrame = $_POST['bookTime'];
if (isset($_POST['submitBook'])) {
    if (empty($_POST['bookSeats'])) {
        $bookSeatsError = "You need to select the number of seats";
    }
    if (empty($_POST['bookTime'])) {
        $bookTimeError = "You need to select the time frame for your reservation";
    }
    if (empty($_POST['bookDate'])) {
        $bookTimeError = "You need to select a date for your reservation";
    }
    function check_status($BookingDate, $TimeFrame, $SelectedTableID)
    {
        $sql = "SELECT table_id FROM booking WHERE reservation_date='{$BookingDate}' AND booking_timeframe='{$TimeFrame}' AND table_id='{$SelectedTableID}' ";
        $result = mysqli_query(mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME), $sql);
        if (mysqli_num_rows($result) > 0) {
            return 1;
        } else {
            return 0;
        }
    }
    if (check_status($BookingDate, $TimeFrame, $SelectedTableID) == 1) {
        redirect_to('../reservation.php?MiD=10');
    }
}
Example #9
0
File: tms.php Project: norico/tms3
function do_start($server, $dedi_cfg, $config)
{
    $pid_file = $config->pid . $dedi_cfg->masterserver_account->login . ".txt";
    if (file_exists($pid_file)) {
        check_status($server, $dedi_cfg, $config);
        throw new Exception('pid file already exist');
    }
    echo color("\n Starting server", "green") . $dedi_cfg->masterserver_account->login . " (" . $dedi_cfg->system_config->xmlrpc_port . ")\n\n";
    if (!file_exists($config->dedicated->exec . $config->dedicated->tracks . "MatchSettings/" . $dedi_cfg->masterserver_account->login . ".txt")) {
        throw new Exception($config->dedicated->exec . $config->dedicated->tracks . "MatchSettings/" . $dedi_cfg->masterserver_account->login . ".txt does not exist");
    }
    /* command line */
    $cmd = "cd " . $config->dedicated->exec . "; ./TrackmaniaServer /dedicated_cfg=dedicated_cfg." . $dedi_cfg->masterserver_account->login . ".txt /game_settings=MatchSettings/" . $dedi_cfg->masterserver_account->login . ".txt";
    $pid_dump = system($cmd);
    $find = "pid=";
    $matches = explode(' ', substr($pid_dump, strpos($pid_dump, $find), 50));
    $pid = substr($matches[0], 4);
    $console = substr($matches[1], 8, -2);
    $data = array("pid" => intval($pid), "console" => intval($console), "xmlrpc_port" => intval($dedi_cfg->system_config->xmlrpc_port));
    /*
    	
    	if (!mkdir($config->pid, 0, true)) {
        throw new Exception("unable to create pid dir");
    	}
    */
    file_put_contents($config->pid . $dedi_cfg->masterserver_account->login . ".txt", json_encode($data));
    echo "\n";
    sleep(2);
    check_status($server, $dedi_cfg, $config);
}
Example #10
0
<?php

$check_system = true;
$check_result = check_status();
foreach ($check_result as $name => $value) {
    if ($value !== true) {
        $check_system = false;
        break;
    }
}
if ($check_system === false) {
    ?>
	<h1>安装环境检查结果</h1>
	<table class="table table-condensed">
		<thead>
		<tr>
			<th>组件</th>
			<th>状态</th>
		</tr>
		</thead>
		<tbody>
		<?php 
    foreach ($check_result as $name => $value) {
        ?>
			<tr class="<?php 
        echo $value ? "success" : "danger";
        ?>
">
				<td><?php 
        echo $name;
        ?>
         }
     }
     $b = $j % 2;
     $bgcolor = '';
     if ($b == 0) {
         $bgcolor = '#B8E7FF';
     }
     $table_data = new Smarty_NM();
     if ($j == 0) {
         $table_selector = $table_data->fetch("dashboard_header_location.tpl");
     }
     $action = sprintf("show_dashboard.php?group=0&lokatie=%s", $field_location->lokatie);
     $table_data->assign("bgcolor", $bgcolor);
     $table_data->assign("location", $field_location->lokatie);
     $table_data->assign("datetime", $field_location->creation_time);
     $status_array = check_status($qc_status);
     $table_data->assign("status_img", $status_array['img']);
     $table_data->assign("status_txt", $status_array['txt']);
     if (!empty($gewenste_processen)) {
         if (!$qc_freq_status) {
             $table_data->assign("qc_frequency", "1 of meerdere qc's te laat");
             $table_data->assign("waarde_class", "table_data_red");
         } else {
             $table_data->assign("qc_frequency", "ok");
             $table_data->assign("waarde_class", "table_data_green");
         }
     }
     $table_data->assign("action_location", $action);
     $table_selector .= $table_data->fetch("dashboard_row_location.tpl");
     $j++;
 }
Example #12
0
function gw_waitForStartup()
{
    $xml_parser = xml_parser_create();
    xml_set_element_handler($xml_parser, "startElement", "endElement");
    $kannelSmscOnlineStatus = "online";
    $kannelStatusUrl = loadKannelStatusUrl();
    // first get the total number of SMSCs
    $kannelStatusXml = file_get_contents($kannelStatusUrl);
    $ids = explode(' ', get_smscids('', $kannelStatusXml));
    $numIds = count($ids);
    // now keep waiting until the number of
    // online SMSCs equals the total number
    //
    echo "waiting...";
    while ($numIds != check_status($kannelSmscOnlineStatus, $kannelStatusXml)) {
        echo ".";
        sleep(5);
        $kannelStatusXml = file_get_contents($kannelStatusUrl);
    }
    echo "\n";
    xml_parser_free($xml_parser);
}
Example #13
0
        ?>
</td>
        <td><?php 
        echo $item['db_md5sum'];
        ?>
</td-->
        <td><?php 
        echo round($item['db_size'] / 1024 / 1024, 2);
        ?>
</td>
        <td><?php 
        echo check_status($item['suc_flag']);
        ?>
</td>
        <td><?php 
        echo check_status($item['del_flag']);
        ?>
</td>
        <td><?php 
        echo $item['date'];
        ?>
</td>
        <td><?php 
        echo $item['modify_time'];
        ?>
</td>
    </tr>
 <?php 
    }
    ?>
  <!--tr>
Example #14
0
 // Generate the unique name. Keep generating new names until one that is not in use is found.
 do {
     // Create a random seed by taking the first 8 characters of an MD5 hash of a concatenation of the current UNIX epoch time and the current server process ID.
     $seed = substr(md5(uniqid("")), 0, 8);
     // Assemble the file path.
     $path_to_image = './' . $CONFIG['fullpath'] . 'edit/' . $prefix . $seed . '.' . $suffix;
 } while (file_exists($path_to_image));
 // Create a holder called $tempname.
 $tempname = $prefix . $seed . '.' . $suffix;
 // The file name $path_to_image has been created. We must prepare to download the resource. First, we will attemt to detect the status code for the resource.
 // Open a stream to the resource.
 $fp = fopen($URI_name, "rb");
 // Check to see if the resource was opened.
 if (!$fp) {
     // Attempt to get the status of the resource.
     $response = check_status($URI_name);
     // Try to parse header if we were able to get a response.
     if ($response) {
         if (strstr($response, '401')) {
             // 401 Unauthorized - Authorization needed to obtain resource. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_401']);
         } elseif (strstr($response, '402')) {
             // 402 Payment Required -  Where's the cash? :-) Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_402']);
         } elseif (strstr($response, '403')) {
             // 403 Forbidden - No permission to access the resource. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_403']);
         } elseif (strstr($response, '404')) {
             // 404 Not Found - The resource is missing. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_404']);
         } elseif (strstr($response, '500')) {
Example #15
0
        ?>
</td>
        <td><?php 
        echo $item['mem_bits'];
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_resident']);
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_virtual']);
        ?>
</td>
        <td><?php 
        echo check_status($item['mem_supported']);
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_mapped']);
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_mappedWithJournal']);
        ?>
</td>
        <td><a href="<?php 
        echo site_url('mongodb/chart/' . $item['server_id']);
        ?>
"><img src="./images/chart.gif"/></a></a></td>
     </tr>
Example #16
0
	<th>Email</th><td colspan="2"><?php 
echo $rows->email;
?>
</td>
	</tr>

	<tr>
	<th>Username</th><td colspan="2"><?php 
echo $rows->username;
?>
</td>
	</tr>

	<tr>
	<th>User Status</th><td colspan="2"><?php 
echo check_status($rows->user_status);
?>
</td>
	</tr>
		
	<tr>
	<th>User Position</th><td width="197"><?php 
echo check_position($rows->user_position);
?>
</td>
	</tr>
		
	</tbody>
	</table>
	</div><!-- /.box-body -->
  </div><!-- /.box -->
Example #17
0
    // Return list of "selected" users for 'list_to_send'
    // Return list of "treated" check_key for 'send'
    return $return_list;
}
// +-----------------------------------------------------------------------+
// | Main                                                                  |
// +-----------------------------------------------------------------------+
if (!isset($_GET['mode'])) {
    $page['mode'] = 'send';
} else {
    $page['mode'] = $_GET['mode'];
}
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(get_tab_status($page['mode']));
// +-----------------------------------------------------------------------+
// | Add event handler                                                     |
// +-----------------------------------------------------------------------+
add_event_handler('nbm_render_global_customize_mail_content', 'render_global_customize_mail_content');
trigger_notify('nbm_event_handler_added');
// +-----------------------------------------------------------------------+
// | Insert new users with mails                                           |
// +-----------------------------------------------------------------------+
if (!isset($_POST) or count($_POST) == 0) {
    // No insert data in post mode
    insert_new_data_user_mail_notification();
}
// +-----------------------------------------------------------------------+
// | Treatment of tab post                                                 |
// +-----------------------------------------------------------------------+
Example #18
0
    } else {
        echo "<a href=\"#\" class=href onClick=\"do_alert('";
        echo "smsc-ids in dead state are\\n\\n";
        echo get_smscids("dead", $status[$inst]);
        echo "');\"><span class=text><b>{$x}</b> links</span></a>";
    }
    echo "<br />\n";
}
echo "<hr size=1>\n";
echo "(all) {$sum} links <br />\n";
?>
</td><td valign=top align=right class=text>
    <?php 
$sum = 0;
foreach ($configs as $inst => $config) {
    $x = check_status("unknown", $status[$inst]);
    $sum += $x;
    echo "({$inst}) ";
    if ($x == 0) {
        echo "<span class=text>none</span>";
    } else {
        echo "<a href=\"#\" class=href onClick=\"do_alert('";
        echo "smsc-ids in unknown state are\\n\\n";
        echo get_smscids("unknown", $status[$inst]);
        echo "');\"><span class=text><b>{$x}</b> links</span></a>";
    }
    echo "<br />\n";
}
echo "<hr size=1>\n";
echo "(all) {$sum} links <br />\n";
?>
Example #19
0
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
// customize appearance of the site for a user
// +-----------------------------------------------------------------------+
// |                           initialization                              |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH')) {
    //direct script access
    define('PHPWG_ROOT_PATH', './');
    include_once PHPWG_ROOT_PATH . 'include/common.inc.php';
    // +-----------------------------------------------------------------------+
    // | Check Access and exit when user status is not ok                      |
    // +-----------------------------------------------------------------------+
    check_status(ACCESS_CLASSIC);
    if (!empty($_POST)) {
        check_pwg_token();
    }
    $userdata = $user;
    trigger_notify('loc_begin_profile');
    // Reset to default (Guest) custom settings
    if (isset($_POST['reset_to_default'])) {
        $fields = array('nb_image_page', 'expand', 'show_nb_comments', 'show_nb_hits', 'recent_period', 'show_nb_hits');
        // Get the Guest custom settings
        $query = '
SELECT ' . implode(',', $fields) . '
  FROM ' . USER_INFOS_TABLE . '
  WHERE user_id = ' . $conf['default_user_id'] . '
;';
        $result = pwg_query($query);
Example #20
0
if (PHP_SAPI !== 'cli') {
    die('Must be from command line');
}
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
define('ROOT_PATH', realpath(dirname(__FILE__)) . '/');
$host = isset($argv[1]) ? $argv[1] : false;
$port = isset($argv[2]) ? $argv[2] : 80;
$email = isset($argv[3]) ? $argv[3] : false;
if ($host === false) {
    die('No host');
}
try {
    check_status($host, $port);
} catch (ErrorException $e) {
    handle_failure($host . $port);
}
function check_status($host, $port = 80)
{
    $waitTimeoutInSeconds = 1;
    $fp = @fsockopen($host, $port, $errCode, $errStr, $waitTimeoutInSeconds);
    if ($fp) {
        handle_success($host . $port);
        fclose($fp);
    } else {
        handle_failure($host . $port);
    }
}
function send_email($subject, $message = "")
Example #21
0
</td>
        <td><?php 
        echo $item['create_time'];
        ?>
</td>
        <td><?php 
        if ($item['message'] != 'OK') {
            echo check_status($item['send_mail']);
        } else {
            echo "------";
        }
        ?>
</td>
        <td><?php 
        if ($item['message'] != 'OK') {
            echo check_status($item['send_mail_status']);
        } else {
            echo "------";
        }
        ?>
</td>
	</tr>
 <?php 
    }
} else {
    ?>
<tr>
<td colspan="12">
<font color="red"><?php 
    echo $this->lang->line('no_record');
    ?>
Example #22
0
$query_for_list_of_users = mysql_query("select first_name,last_name,id_no from user where id_no!='{$memid}'");
echo "\n<table>\n<tbody>\n";
if (mysql_num_rows($query_for_list_of_users) > 0) {
    while ($rows_for_list_of_users = mysql_fetch_array($query_for_list_of_users)) {
        $first_name = $rows_for_list_of_users['first_name'];
        $last_name = $rows_for_list_of_users['last_name'];
        $id_no = $rows_for_list_of_users['id_no'];
        $name = $first_name . " " . $last_name;
        echo "<tr><td><a href='index.php?x=" . $id_no . "'>" . $name . "</a></td>";
        if (check_status($id_no, $memid) == 1) {
            echo "<td>Friend</td></tr>";
        } else {
            if (check_status($id_no, $memid) == 2) {
                echo "<td><button id='friend_request' onclick='javascript:request_send_accept_response(" . $memid . "," . $id_no . ",2);'>Accept Friend Request</button></td></tr>";
            } else {
                if (check_status($id_no, $memid) == 3) {
                    echo "<td><button id='friend_request' onclick='javascript:request_send_accept_response(" . $memid . "," . $id_no . ",3);'>Friend Request Sent</button></td></tr>";
                } else {
                    if (check_status($id_no, $memid) == 4) {
                        echo "<td><button id='friend_request' onclick='javascript:request_send_accept_response(" . $memid . "," . $id_no . ",4);'>Send friend Request</button></td></tr>";
                    } else {
                        if (check_status($id_no, $memid) == 0) {
                            echo "</tr>";
                        }
                    }
                }
            }
        }
    }
    echo "</tbody></table>";
}
Example #23
0
    if (!$link) {
        return;
    }
    if (!check_database($link)) {
        mysql_close($link);
        return;
    }
    if (!check_tables($link)) {
        mysql_close($link);
        return;
    }
    if (!check_columns($link)) {
        mysql_close($link);
        return;
    }
    check_sound();
    $page['done'][] = getlocal("installed.message");
    if (!check_admin($link)) {
        $page['nextstep'] = getlocal("installed.login_link");
        $page['nextnotice'] = getlocal2("installed.notice", array("{$webimroot}/install/"));
        $page['nextstepurl'] = "{$webimroot}/operator/login.php?login=admin";
    }
    $page['show_small_login'] = true;
    mysql_close($link);
    loadsettings();
    $settings['dbversion'] = $dbversion;
    update_settings();
}
check_status();
start_html_output();
require '../view/install_index.php';
Example #24
0
"><?php 
echo $rows->email;
?>
</a></td>
	</tr>
		
	<tr>
	<th>Source</th><td><?php 
echo $rows->source;
?>
</td>
	</tr>

	<tr>
	<th>Status</th><td><?php 
echo check_status($rows->active);
?>
</td>
	</tr>
		
	<tr>
	<th>Notes</th><td><?php 
echo $rows->notes;
?>
</td>
	</tr>
		
	<tr>
	  <?php 
$date = new DateTime($rows->date);
?>
Example #25
0
        ?>
</strong></td>
        <td><?php 
        echo $item['address'];
        ?>
</td>
        <td><?php 
        echo $item['on_duty_tel'];
        ?>
</td>
        <td><?php 
        echo $item['remark'];
        ?>
</td>
		<td><?php 
        echo check_status($item['status']);
        ?>
</td>
        <td><a href="<?php 
        echo site_url('machine_room/edit/' . $item['id']);
        ?>
"  title="<?php 
        echo $this->lang->line('edit');
        ?>
" ><i class="icon-pencil"></i></a>&nbsp;
        <a href="<?php 
        echo site_url('machine_room/forever_delete/' . $item['id']);
        ?>
" class="confirm_delete" title="<?php 
        echo $this->lang->line('forever_delete');
        ?>
Example #26
0
 // Generate the unique name. Keep generating new names until one that is not in use is found.
 do {
     // Create a random seed by taking the first 8 characters of an MD5 hash of a concatenation of the current UNIX epoch time and the current server process ID.
     $seed = substr(md5(uniqid("")), 0, 8);
     // Assemble the file path.
     $path_to_image = './' . $CONFIG['fullpath'] . 'edit/' . $prefix . $seed . '.' . $suffix;
 } while (file_exists($path_to_image));
 // Create a holder called $tempname.
 $tempname = $prefix . $seed . '.' . $suffix;
 // The file name $path_to_image has been created. We must prepare to download the resource. First, we will attemt to detect the status code for the resource.
 // Open a stream to the resource.
 $fp = fopen($_POST['URI_array'][$counter], "rb");
 // Check to see if the resource was opened.
 if (!$fp) {
     // Attempt to get the status of the resource.
     $response = check_status($_POST['URI_array'][$counter]);
     // Try to parse header if we were able to get a response.
     if ($response) {
         if (strstr($response, '401')) {
             // 401 Unauthorized - Authorization needed to obtain resource. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $_POST['URI_array'][$counter], 'error_code' => $lang_upload_php['http_401']);
         } elseif (strstr($response, '402')) {
             // 402 Payment Required -  Where's the cash? :-) Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $_POST['URI_array'][$counter], 'error_code' => $lang_upload_php['http_402']);
         } elseif (strstr($response, '403')) {
             // 403 Forbidden - No permission to access the resource. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $_POST['URI_array'][$counter], 'error_code' => $lang_upload_php['http_403']);
         } elseif (strstr($response, '404')) {
             // 404 Not Found - The resource is missing. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $_POST['URI_array'][$counter], 'error_code' => $lang_upload_php['http_404']);
         } elseif (strstr($response, '500')) {
Example #27
0
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH')) {
    die('Hacking attempt!');
}
include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_ADMINISTRATOR);
trigger_notify('loc_begin_cat_list');
if (!empty($_POST) or isset($_GET['delete'])) {
    check_pwg_token();
}
$sort_orders = array('name ASC' => l10n('Album name, A &rarr; Z'), 'name DESC' => l10n('Album name, Z &rarr; A'), 'date_creation DESC' => l10n('Date created, new &rarr; old'), 'date_creation ASC' => l10n('Date created, old &rarr; new'), 'date_available DESC' => l10n('Date posted, new &rarr; old'), 'date_available ASC' => l10n('Date posted, old &rarr; new'));
// +-----------------------------------------------------------------------+
// |                               functions                               |
// +-----------------------------------------------------------------------+
/**
 * save the rank depending on given categories order
 *
 * The list of ordered categories id is supposed to be in the same parent
 * category
 *
 * @param array categories
Example #28
0
if (!empty($datalist)) {
    ?>
 <?php 
    foreach ($datalist as $item) {
        ?>
    <tr style="font-size: 12px;">
        <td><?php 
        echo $item['host'] . ':' . $item['port'];
        ?>
</td>
        <td><?php 
        echo check_role($item['is_master'], $item['is_slave']);
        ?>
</td>
        <td><?php 
        echo check_status($item['slave_read_only']);
        ?>
</td>
        <td><?php 
        echo $item['application'];
        ?>
</td>
        <td><?php 
        echo $item['slave_priority'];
        ?>
</td>
        <td><?php 
        echo check_value($item['master_link_status']);
        ?>
</td>
	<!--td><?php