<tr><td>Email</td>
	<td><input type="text" name="call_email" id="call_email" value="<?php 
echo $user_info->user_email;
?>
" required></td></tr>
	
	<tr><td>Phone</td>
	<td><input type="text" name="call_phone" class="input-medium" value="<?php 
echo $user_info->user_phone;
?>
"></td></tr>

	<tr><td>Department</td><td><select name='call_department'>
	<option></option>
	<?php 
$call_dept = $db->get_results("select type_id,type_name from site_types where type=1 order by type_name;");
foreach ($call_dept as $dept) {
    ?>
	<option value='<?php 
    echo $dept->type_id;
    ?>
'><?php 
    echo $dept->type_name;
    ?>
</option>
<?php 
}
?>
	</select></td></tr>

	<tr><td>Request</td><td><select name='call_request'>
Beispiel #2
0
        $searchquery .= " AND (call_request = {$call_request})";
    }
    if (!empty($call_device)) {
        $searchquery .= " AND (call_device = {$call_device})";
    }
    if (!empty($call_staff)) {
        $searchquery .= " AND (call_staff = {$call_staff})";
    }
    if (!empty($call_details)) {
        $searchquery .= " AND (call_details LIKE '%{$call_details}%')";
    }
    if (!empty($call_solution)) {
        $searchquery .= " AND (call_solution LIKE '%{$call_solution}%')";
    }
    $searchquery .= " order by call_date desc LIMIT 50;";
    $site_calls = $db->get_results("Select * from site_calls WHERE 1=1 {$searchquery}");
    //$db->debug();
    $num = $db->num_rows;
}
//</SEARCHQUERY>
if ($num > 0) {
    //<RESULTS>
    echo "<h4><small>[ " . $num . " ] found</small></h4>";
    ?>
<table class="<?php 
    echo $table_style_3;
    ?>
" style='width: auto;'>
<tr>
	<th colspan="<?php 
    echo $colspan;
Beispiel #3
0
//	$is_valid = 0;
//}
if ($is_valid != 1) {
    $_SESSION['hit'] += 1;
    echo "<div class='alert alert-warning' style='width: 375px;'><i class='glyphicon glyphicon-info-sign'></i> Login incorrect, or your registration is pending.</div>";
    include "includes/footer.php";
    exit;
}
$id = $_SESSION[id];
$nama = $_SESSION[nama];
//$site_users = $db->get_row("select user_id,user_name,user_level from site_users WHERE $checkusing = '$user_login' limit 1;");
$user_id = $id;
$user_name = $nama;
//$user_level = $site_users->user_level;
echo $id;
$sqlrole = $db->get_results("select user_role2role_role_id from w_user_role2role where user_role2role_user_id='{$id}'");
foreach ($sqlrole as $sqlrolenya) {
    $rolenya = $sqlrolenya->user_role2role_role_id;
    echo $rolenya;
    if ($rolenya == 2 || $rolenya == 27) {
        $user_level = 0;
    } else {
        $user_level = 1;
    }
}
if ($user_level == 0) {
    $_SESSION['admin'] = 1;
} else {
    $_SESSION['user'] = 1;
}
$_SESSION['user_id'] = $user_id;
Beispiel #4
0
$encrypted_passwords = $db->get_var("SELECT option_value FROM site_options where option_name = 'encrypted_passwords';");
if ($encrypted_passwords == "yes") {
    echo "<p class='text-danger'><strong>This function has already been run!</strong></p>";
    include "includes/footer.php";
    exit;
}
?>

<h4><strong>Please <u>backup database</u> before starting.</strong></h4>

<p><a href="fhd_admin_e.php?start=1" class="btn btn-success" onclick="return confirm('Please be sure you have a good database backup!')">Start</a> <a href="fhd_settings.php" class="btn btn-danger">Cancel</a></p>

<?php 
if (isset($_GET['start'])) {
    $db->query("ALTER TABLE `site_users` CHANGE `user_password` `user_password` VARCHAR( 225 );");
    $myquery = "SELECT user_id,user_login,user_password from site_users;";
    $e = $db->get_results($myquery);
    foreach ($e as $ep) {
        $user_id = $ep->user_id;
        $user_login = $ep->user_login;
        $user_password = $ep->user_password;
        $hasher = new PasswordHash(8, false);
        $hash = $hasher->HashPassword($user_password);
        echo $user_login . " -> <i class='fa fa-lock'></i><br />";
        $db->query("UPDATE `site_users` SET user_password = '******' WHERE user_id = {$user_id} limit 1;");
    }
    echo "<h4>Update Complete!</h4>";
    //mark passwords as updated.
    $db->query("UPDATE `site_options` SET option_value = 'yes' WHERE option_name = 'encrypted_passwords';");
}
include "includes/footer.php";
Beispiel #5
0
include "includes/ez_sql_mysqli.php";
include "includes/functions.php";
$db = new ezSQL_mysqli(db_user, db_password, db_name, db_host);
$queryadd = "";
$colspan = 2;
if ($user_level == 1) {
    $queryadd = " AND call_user = {$user_id}";
    $colspan = 1;
}
if (isset($_GET['user_id'])) {
    $queryadd = " AND call_user = "******"SELECT call_id,call_date,call_first_name,call_last_name,call_request,call_department,call_device from site_calls WHERE (call_status = 0) $queryadd order by call_id desc;";
$myquery = "SELECT call_id,call_date,call_first_name,call_last_name,call_request,call_department,call_device from site_calls WHERE (call_status = 0) order by call_id desc;";
$site_calls = $db->get_results($myquery);
$num = $db->num_rows;
//$db->debug();
echo "<h4><i class='fa fa-tags'></i> &nbsp; Laporan Masalah <small>[ {$num} ]</small></h4>";
if ($num > 0) {
    ?>
<table class="<?php 
    echo $table_style_1;
    ?>
" style='width: auto;'>
<tr>
	<th colspan="<?php 
    echo $colspan;
    ?>
" style='text-align: center;'>Action</th>
	<?php 
echo "<tr><td>Status</td><td>" . call_status($site_calls->call_status) . "</td></tr>\n";
echo "<tr><td>Date</td><td>" . $call_date . "</td></tr>\n";
if ($call_status == 1) {
    echo "<tr><td>Closed</td><td>" . date('Y-m-d', $site_calls->call_date2) . "</td></tr>\n";
}
echo "<tr><td>Name</td><td>" . $site_calls->call_first_name . "</td></tr>\n";
echo "<tr><td>Email</td><td>" . $site_calls->call_email . "</td></tr>\n";
echo "<tr><td>Dept</td><td>{$department_name}</td></tr>\n";
echo "<tr><td>Request</td><td>{$request_name}</td></tr>\n";
echo "<tr><td>Device</td><td>{$device_name}</td></tr>\n";
echo "<tr><td>Details</td><td style='width: 500px;'>" . $site_calls->call_details . "</td></tr>\n";
echo "<tr><td>Solution</td><td style='width: 500px;'>" . $site_calls->call_solution . "</td></tr>\n";
echo "<tr><td>Staff</td><td>{$staff_name}</td></tr>\n";
//********** manage file upload
if (FHD_UPLOAD_ALLOW == "yes") {
    $getuploads = $db->get_results("SELECT id,call_id,file_name,file_ext,timestamp FROM site_upload WHERE call_id = {$call_id};");
    $filecount = $db->num_rows;
    if ($filecount > 0) {
        echo "<tr><td colspan='2'>Uploads ({$filecount})</td></tr>\n";
        foreach ($getuploads as $fn) {
            $call_id = $fn->call_id;
            $file_id = $fn->id;
            $file_name = $fn->file_name;
            $file_ext = $fn->file_ext;
            $timestamp = $fn->timestamp;
            $realpath = md5(UPLOAD_KEY . $file_id) . "." . $file_ext;
            echo "<tr><td colspan='2'><a href='upload/" . $realpath . "'>{$file_name}</a> &bull; {$timestamp}</td></tr>\n";
        }
    }
}
//*********************************
	
	<tr><td>Email</td>
	<td><input type="text" name="call_email" value="<?php 
echo $site_calls->call_email;
?>
" class="input-xlarge"></td></tr>
	
	<tr><td>Phone</td>
	<td><input type="text" name="call_phone" value="<?php 
echo $site_calls->call_phone;
?>
" class="input-medium"></td></tr>

	<tr><td>Dept</td><td><select name='call_department'>
	<?php 
$call_dept = $db->get_results("select type_id,type_name from site_types where type=1");
foreach ($call_dept as $dept) {
    ?>
	<option value='<?php 
    echo $dept->type_id;
    ?>
'<?php 
    if ($dept->type_id == $call_department) {
        echo ' selected';
    }
    ?>
><?php 
    echo $dept->type_name;
    ?>
</option>
<?php 
<?php 
    }
    ?>
	<th>Edit</th>
	<th>Delete</th>
	<?php 
    if ($type != 0) {
        ?>
	<th>Calls</th>
	<?php 
    }
    ?>
</tr>
<?php 
    $nacl = md5(AUTH_KEY . $db->get_var("select last_login from site_users where user_id = {$user_id};"));
    $site_types = $db->get_results("SELECT type_id,type,type_name,type_email,type_location,type_phone from site_types where type = {$type} order by type_name;");
    foreach ($site_types as $site_type) {
        $type_id = $site_type->type_id;
        $type = $site_type->type;
        $type_name = $site_type->type_name;
        $type_email = $site_type->type_email;
        $type_location = $site_type->type_location;
        $type_phone = $site_type->type_phone;
        $col_name = show_type_col($type);
        $count = $db->get_var("select count(call_id) from site_calls where {$col_name} = {$type_id};");
        if ($count == 0) {
            //if there are no calls, then the category can be removed.
            $deletelink = "<a href='fhd_settings_action.php?type_id={$type_id}&type={$type}&action=delete&nacl={$nacl}' onclick=\"return confirm('Are you sure you want to delete?')\"><i class='glyphicon glyphicon-remove-circle' title='delete'></i></a>";
        } else {
            $deletelink = "&nbsp;";
        }
Beispiel #9
0
	<td><input type="text" name="call_first_name" class="input-xlarge" required></td>
	</tr>
	
	<tr>
	<td>Email</td>
	<td><input type="email" name="call_email" class="input-xlarge" required></td>
	</tr>
	
	<tr>
	<td>Phone</td>
	<td><input type="text" name="call_phone" class="input-medium"></td>
	</tr>

	<tr><td>Departtment</td><td><select name='call_department'>
	<?php 
$call_dept = $db->get_results("select type_id,type_name from site_types where type=1 order by type_name;");
foreach ($call_dept as $dept) {
    ?>
	<option value='<?php 
    echo $dept->type_id;
    ?>
'><?php 
    echo $dept->type_name;
    ?>
</option>
<?php 
}
?>
	</select></td></tr>

	<tr><td>Request</td><td><select name='call_request'>
Beispiel #10
0
/**********************************************************************
 *  ezSQL initialisation for mySQLi
 */
// Include ezSQL core
include_once "../shared/ez_sql_core.php";
// Include ezSQL database specific component
include_once "ez_sql_mysqli.php";
// Initialise database object and establish a connection
// at the same time - db_user / db_password / db_name / db_host
// db_host can "host:port" notation if you need to specify a custom port
$db = new ezSQL_mysqli('db_user', 'db_password', 'db_name', 'db_host');
/**********************************************************************
 *  ezSQL demo for mySQLi database
 */
// Demo of getting a single variable from the db
// (and using abstracted function sysdate)
$current_time = $db->get_var("SELECT " . $db->sysdate());
print "ezSQL demo for mySQL database run @ {$current_time}";
// Print out last query and results..
$db->debug();
// Get list of tables from current database..
$my_tables = $db->get_results("SHOW TABLES", ARRAY_N);
// Print out last query and results..
$db->debug();
// Loop through each row of results..
foreach ($my_tables as $table) {
    // Get results of DESC table..
    $db->get_results("DESC {$table['0']}");
    // Print out last query and results..
    $db->debug();
}