" type="text/css"/>
//return which project,version,type am i: amaze,maporama,orange....
$sqlqry = "SELECT * FROM app_types WHERE public_name='$g_app_public_name'";
$rs = mt_odbc_exec($conn, $sqlqry);
$ids = odbc_fetch_object($rs);
$type_id=$ids->app_type_id;
$sqlqry = "SELECT * FROM app_versions WHERE app_version_name='$g_app_version_name'";
$rs = mt_odbc_exec($conn, $sqlqry);
$ids = odbc_fetch_object($rs);
$version_id=$ids->app_version_id;
$sqlqry = "update app_versions_devices_types set disabled=1 where Has_Another_Version=0 and app_version_id=$version_id and app_type_id=$type_id";
$rs = mt_odbc_exec($conn, $sqlqry);
// Draw icon
//if (isset($g_app_version_name)) $class=getLogo($screenWidth, $is_3g, $g_app_version_name, $conn);
// If user chose a device, or device was automatically identified, show device download link
$g_device_id_new=$g_device_id;
$device_per_vendoer=false;
$http= $_SERVER['REQUEST_URI'];
$device_id_link = $_REQUEST['device_id'];
$vendor_all = $_REQUEST['vendor'];
if ($device_id_link!="")
{
$g_device_id=$device_id_link;
$pos = stripos($g_device_id,'?');
if ($pos === 0)
{
$g_device_id=$g_device_id_new;
}
}
if ($vendor_all=="all")
{
$g_device_id ="all";
}
if($g_device_id=="NA")
{
$g_device_id="";
}
$flag="true";
$sqlqry = "select * from vu_apps_devices where app_version_name = '$g_app_version_name'" .
"AND public_name='$g_app_public_name' " .
"AND device_id='$g_device_id' ";
$rs = mt_odbc_exec($conn, $sqlqry);
$device_params = odbc_fetch_object($rs);
if($device_params == NULL || $device_params->app_type=="")
{
$devices = get_vendors_array(6,$version_id,$type_id);
foreach ($devices as $vendor=>$models)
{
$vendor=mb_strtolower($vendor);
$g_device_id=mb_strtolower($g_device_id);
if($vendor==$g_device_id)
{
$device_per_vendoer=true;
$vendor_new=$g_device_id;
break;
}
else
{
$flag="false";
}
}
}
//this if execute after we select venndor and device
if (isset($g_device_id) && !empty($g_device_id) && $g_device_id != 'all' && strpos($http,"vendor")==false && $flag!="false")
{
$sqlqry = "select * from vu_apps_devices where app_version_name = '$g_app_version_name'" .
"AND public_name='$g_app_public_name' " .
"AND device_id='$g_device_id' ";
$rs = mt_odbc_exec($conn, $sqlqry);
$device_params = odbc_fetch_object($rs);
//$app_name = $device_params->app_type . ' ' . $device_params->version;
$device_name = $device_params->make . ' ' . $device_params->model;
// get matching device's file
if (empty($device_params->file_name))
{
$matching_device_id = $device_params->matching_device_id;
$sqlqry = "select * from vu_apps_devices where app_version_name = '$g_app_version_name'" .
"AND public_name='$g_app_public_name' " .
"AND device_id='$matching_device_id' ";
$rs = mt_odbc_exec($conn, $sqlqry);
$device_params = odbc_fetch_object($rs);
}
// Look for a record in the language table, if so, offer different downloads according to different languages
$sqlqry = "select * from vu_releases_languages where app_version_id=$device_params->app_version_id and app_type_id=$device_params->app_type_id and device_id='$device_params->device_id'";
$rs = mt_odbc_exec($conn, $sqlqry);
if ($rs && odbc_fetch_object($rs))
{
if (!is_null($device_params->device_comment) && !empty($device_params->device_comment))
{
?>=mb_convert_encoding($device_params->device_comment, "UTF-8", "ISO-8859-8")?>
}
// Run the query again since the above odbc_fetch_object() already got one record
$rs = mt_odbc_exec($conn, $sqlqry);
//TODO: this is a lame fix; find something better
$is_public = $device_params->is_public;
while ($device_params = odbc_fetch_object($rs))
{
$url = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$device_params->device_id/$device_params->language_id/$device_params->file_name";
if ($device_params->add_credentials)
{
$url = "/amAze/jad.php?url=" . urlencode($url);
}
?>
}
if ($is_public)
{
$url = add_token_to_url("/amAze/maporama/genIndex.php/", $g_token);
?>=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_APPLICATION?>.
}
}
else // Just show the single download link
{
//save the type id of your project from the table app_types from db
$sqlqry_newVersion = "select app_type_id from app_types where version='$device_params->version' and app_type='$device_params->app_type'";
$rs_newVersion = mt_odbc_exec($conn, $sqlqry_newVersion);
$newVersion = odbc_fetch_object($rs_newVersion);
$newVersion=$newVersion->app_type_id;
//save the versions of your project from the table app_version from db
$version_name=$device_params->app_version_name;
$sqlqry_app_versions = "select app_version_id from app_versions where app_version_name='$version_name'";
$rs_app_versions = mt_odbc_exec($conn, $sqlqry_app_versions);
$app_versions = odbc_fetch_object($rs_app_versions);
$app_versions=$app_versions->app_version_id;
//want to know if you want to display the UserName and Password
$sqlqry_DisplayUserNamePassword = "select DisplayUserNamePassword from app_versions_devices_types where device_id='$g_device_id' and app_version_id='$app_versions' and app_type_id='$newVersion'";
$rs_DisplayUserNamePassword = mt_odbc_exec($conn, $sqlqry_DisplayUserNamePassword);
$DisplayUserNamePassword = odbc_fetch_object($rs_DisplayUserNamePassword);
//this if execute when we want to display the UserName and Password and take UserName and Password from db with the help of the token
if ($DisplayUserNamePassword->DisplayUserNamePassword!=0)
{
function decrypt_password($password)
{
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, ENCRYPT_KEY, $password, MCRYPT_MODE_ECB, ENCRYPT_IV));
}
function get_user_by_token($token)
{
$user_details = null;
try
{
$dbh = get_pdo_connection();
$DBNAME=AMAZE_DBNAME;
if ($res = mt_pdo_quary($dbh,"EXEC $DBNAME.dbo.sp_get_user_by_token '$token'"))
//$dbh->query("EXEC $DBNAME.dbo.sp_get_user_by_token '$token'"))
{
$user_details = $res->fetch(PDO::FETCH_ASSOC);
if ($user_details)
{
$user_details['password'] = decrypt_password(base64_decode($user_details['password']));
}
else
{
$user_details="";
}
}
else
{
m_log("pdo-user query error - return null");
}
$dbh = null;
}
catch (PDOException $e)
{
m_log("pdo-user query error - Exception");
}
return $user_details;
}
if ($g_token)
{
$user_details = get_user_by_token($g_token);
if($user_details!="")
{?>
=$STRING_FOR_USER_NAME.strtoupper($user_details["user_name"]);?>
=$STRING_FOR_USER_PASSWORD.strtoupper($user_details["password"]);?>
}
else
{
get_new_user_by_token_after_10_minute($g_token,'maporama');
}?>
=$STRING_Note;?>
}
else
{
$user_details = false;
}
}
//this have 2 options: 1)just file name for exeample:amazegps.jad 2) with directory for exeample: xxx/amazegps.jad or xxx\amazegps.jad
//$url = "/maporama/download_server/$device_params->app_version_name/$device_params->public_name/$device_params->device_id/getit/";
$string1 = "\\";
$string2 = "/";
$container = $device_params->file_name;
$container_jar=$container;
$container_jar = explode(".", $container_jar);
if($container_jar[1]=="jad")
{
$container_jar=$container_jar[0]."."."jar";
}
else
{
$container_jar=$container_jar[0].".".$container_jar[1];
}
if(strstr($container,$string1) || strstr($container,$string2))
{
$newFolder="$device_params->file_name";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$device=$type[0];
$container_jar=$type[1];
$newFolder_jar="$device/$container_jar";
}
else
{
$newFolder="$device_params->device_id/$device_params->file_name";
$newFolder_jar="$device_params->device_id/$container_jar";
}
$container = $device_params->file_name_zip;
if(strstr($container,$string1) || strstr($container,$string2))
{
$newFolder_zip="$device_params->file_name_zip";
}
else
{
$newFolder_zip="$device_params->device_id/$device_params->file_name_zip";
}
//chack if the field can_choose_device is true
if ($device_params->can_choose_device)
{
// if ($device_params->add_credentials)
// {
// $url = "/jad.php?url=" . urlencode($url);
// }
// echo "token=$g_token";
$sqlqry_newVersion = "select app_type_id from app_types where version='$device_params->version' and app_type='$device_params->app_type'";
$rs_newVersion = mt_odbc_exec($conn, $sqlqry_newVersion);
$newVersion = odbc_fetch_object($rs_newVersion);
$newVersion=$newVersion->app_type_id;
//save version_name
$version_name=$device_params->app_version_name;
$sqlqry_app_versions = "select app_version_id from app_versions where app_version_name='$version_name'";
$rs_app_versions = mt_odbc_exec($conn, $sqlqry_app_versions);
$app_versions = odbc_fetch_object($rs_app_versions);
$app_versions=$app_versions->app_version_id;
$deg_jad="";
$deg_Signed="";
$deg_other="";
$deg_zip="";
$deg_zip_signed="";
$deg_zip_other="";
$sum_jad=0;
$sum_Signed=0;
$sum_other=0;
$sum_zip=0;
$sum_zip_signed=0;
$sum_zip_other=0;
//this know how many links do you want to show on page like sigen other... and its depends the number you put in the field Has_Another_Version
$sqlqry_Has_Another_Version = "select Has_Another_Version from app_versions_devices_types where device_id='$g_device_id' and app_version_id='$app_versions' and app_type_id='$newVersion'";
$rs_Has_Another_Version = mt_odbc_exec($conn, $sqlqry_Has_Another_Version);
$Has_Another_Version = odbc_fetch_object($rs_Has_Another_Version);
if ($Has_Another_Version->Has_Another_Version!=0)
{
If (($Has_Another_Version->Has_Another_Version & 1) == 1)
{
$sum_jad=$sum_jad+1;
$deg_jad="jad";
$url = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$newFolder";
//$url_zip = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$newFolder_zip";
$typeFile = explode("/", $newFolder);
$url_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]";
//the full path to the jad file on disk
$url_Size=STORAGE_ROOT.$url_Size;
//return the size of jar file
$url_Size=findSizeFile_sum('',$url_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry="$session_id.txt";
//this happend when the device is BlackBerry
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
//return the size of cod file
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url .="&session_id_blackberry=$session_id_blackberry&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 2) == 2)
{
$container = $device_params->file_name;
$newFolder_Signed_jar = explode(".", $container);
$newFolder_Signed_jar=$newFolder_Signed_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_Signed=$sum_Signed+1;
$deg_Signed="Signed";
$url_Signed="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_signed/$type[1]";
$url_Signed = "/amAze/jad.php?url=" . urlencode($url_Signed);
$url_Signed_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_signed";
$url_Signed_Size=STORAGE_ROOT.$url_Signed_Size;
$url_Signed_Size=findSizeFile_sum('',$url_Signed_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_signed=$session_id."_signed.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_signed";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_Signed .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_signed&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_Signed .="&session_id_blackberry=$session_id_blackberry_signed&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 4) == 4)
{
$container = $device_params->file_name;
$newFolder_other_jar = explode(".", $container);
$newFolder_other_jar=$newFolder_other_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_other=$sum_other+1;
$deg_other="other";
$url_other="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other/$type[1]";
$url_other = "/amAze/jad.php?url=" . urlencode($url_other);
$url_other_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other";
$url_other_Size=STORAGE_ROOT.$url_other_Size;
$url_other_Size=findSizeFile_sum('',$url_other_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_other=$session_id."_other.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_other";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_other .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_other&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_other .="&session_id_blackberry=$session_id_blackberry_other&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 8) == 8)
{
$container = $device_params->file_name;
$newFolder_other_signed_jar = explode(".", $container);
$newFolder_other_signed_jar=$newFolder_other_signed_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_other_signed=$sum_other_signed+1;
$deg_other_signed="other_signed";
$url_other_signed="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other_signed/$type[1]";
$url_other_signed = "/amAze/jad.php?url=" . urlencode($url_other_signed);
$url_other_signed_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other_signed";
$url_other_signed_Size=STORAGE_ROOT.$url_other_signed_Size;
$url_other_signed_Size=findSizeFile_sum('',$url_other_signed_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_other_signed=$session_id."_other_signed.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_other_signed";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_other_signed .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_other_signed&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_other_signed .="&session_id_blackberry=$session_id_blackberry_other_signed&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 16) == 16)
{
$sum_zip=$sum_zip+1;
$deg_zip="zip";
$url_zip = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$newFolder_zip";
$typeFile = explode("/", $newFolder_zip);
$url_zip_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]";
$url_zip_Size=STORAGE_ROOT.$url_zip_Size;
$url_zip_Size=findSizeFile_sum('zip',$url_zip_Size);
}
If (($Has_Another_Version->Has_Another_Version & 32) == 32)
{
$sum_zip_signed=$sum_zip_signed+1;
$deg_zip_signed="zip_signed";
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$url_Signed_zip="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_signed/$type[1]";
$url_Signed_zip_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_signed";
$url_Signed_zip_Size=STORAGE_ROOT.$url_Signed_zip_Size;
$url_Signed_zip_Size=findSizeFile_sum('zip',$url_Signed_zip_Size);
}
If (($Has_Another_Version->Has_Another_Version & 64) == 64 )
{
$sum_zip_other=$sum_zip_other+1;
$deg_zip_other="zip_other";
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$url_other_zip="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other/$type[1]";
$url_other_zip_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other";
$url_other_zip_Size=STORAGE_ROOT.$url_other_zip_Size;
$url_other_zip_Size=findSizeFile_sum('zip',$url_other_zip_Size);
}
If (($Has_Another_Version->Has_Another_Version & 128) == 128 )
{
$sum_zip_other_signed=$sum_zip_other_signed+1;
$deg_zip_other_signed="zip_other_signed";
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$url_other_signed_zip="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other_signed/$type[1]";
$url_other_signed_zip_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_other_signed";
$url_other_signed_zip_Size=STORAGE_ROOT.$url_other_signed_zip_Size;
$url_other_signed_zip_Size=findSizeFile_sum('zip',$url_other_signed_zip_Size);
}
If (($Has_Another_Version->Has_Another_Version & 256) == 256)
{
$container = $device_params->file_name;
$newFolder_extra1_jar = explode(".", $container);
$newFolder_extra1_jar=$newFolder_extra1_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_extra1=$sum_extra1+1;
$deg_extra1="extra1";
$url_extra1="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra1/$type[1]";
$url_extra1 = "/amAze/jad.php?url=" . urlencode($url_extra1);
$url_extra1_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra1";
$url_extra1_Size=STORAGE_ROOT.$url_extra1_Size;
$url_extra1_Size=findSizeFile_sum('',$url_extra1_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_extra1=$session_id."_extra1.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra1";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_extra1 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_extra1&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_extra1 .="&session_id_blackberry=$session_id_blackberry_extra1&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 512) == 512)
{
$container = $device_params->file_name;
$newFolder_extra2_jar = explode(".", $container);
$newFolder_extra2_jar=$newFolder_extra2_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_extra2=$sum_extra2+1;
$deg_extra2="extra2";
$url_extra2="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra2/$type[1]";
$url_extra2 = "/amAze/jad.php?url=" . urlencode($url_extra2);
$url_extra2_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra2";
$url_extra2_Size=STORAGE_ROOT.$url_extra2_Size;
$url_extra2_Size=findSizeFile_sum('',$url_extra2_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_extra2=$session_id."_extra2.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra2";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_extra2 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_extra2&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_extra2 .="&session_id_blackberry=$session_id_blackberry_extra2&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 1024) == 1024)
{
$container = $device_params->file_name;
$newFolder_extra3_jar = explode(".", $container);
$newFolder_extra3_jar=$newFolder_extra3_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_extra3=$sum_extra3+1;
$deg_extra3="extra3";
$url_extra3="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra3/$type[1]";
$url_extra3 = "/amAze/jad.php?url=" . urlencode($url_extra3);
$url_extra3_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra3";
$url_extra3_Size=STORAGE_ROOT.$url_extra3_Size;
$url_extra3_Size=findSizeFile_sum('',$url_extra3_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_extra3=$session_id."_extra3.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra3";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_extra3 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_extra3&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_extra3 .="&session_id_blackberry=$session_id_blackberry_extra3&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 2048) == 2048)
{
$container = $device_params->file_name;
$newFolder_extra4_jar = explode(".", $container);
$newFolder_extra4_jar=$newFolder_extra4_jar[0].".jar";
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder);
}
else
{
$type = explode("/", $newFolder);
}
$sum_extra4=$sum_extra4+1;
$deg_extra4="extra4";
$url_extra4="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra4/$type[1]";
$url_extra4 = "/amAze/jad.php?url=" . urlencode($url_extra4);
$url_extra4_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra4";
$url_extra4_Size=STORAGE_ROOT.$url_extra4_Size;
$url_extra4_Size=findSizeFile_sum('',$url_extra4_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_extra4=$session_id."_extra4.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra4";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_extra4 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_extra4&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_extra4 .="&session_id_blackberry=$session_id_blackberry_extra4&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 4096) == 4096)
{
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$sum_zip_extra1=$sum_zip_extra1+1;
$deg_zip_extra1="zip_extra1";
$url_zip_extra1="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra1/$type[1]";
$url_zip_extra1 = "/amAze/jad.php?url=" . urlencode($url_zip_extra1);
$url_zip_extra1_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra1";
$url_zip_extra1_Size=STORAGE_ROOT.$url_zip_extra1_Size;
$url_zip_extra1_Size=findSizeFile_sum('',$url_zip_extra1_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_zip_extra1=$session_id."_zip_extra1.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra1";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_zip_extra1 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_zip_extra1&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_zip_extra1 .="&session_id_blackberry=$session_id_blackberry_zip_extra1&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 8192) == 8192)
{
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$sum_zip_extra2=$sum_zip_extra2+1;
$deg_zip_extra2="zip_extra2";
$url_zip_extra2="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra2/$type[1]";
$url_zip_extra2 = "/amAze/jad.php?url=" . urlencode($url_zip_extra2);
$url_zip_extra2_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra2";
$url_zip_extra2_Size=STORAGE_ROOT.$url_zip_extra2_Size;
$url_zip_extra2_Size=findSizeFile_sum('',$url_zip_extra2_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_zip_extra2=$session_id."_zip_extra2.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra2";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_zip_extra2 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_zip_extra2&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_zip_extra2 .="&session_id_blackberry=$session_id_blackberry_zip_extra2&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 16384) == 16384)
{
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$sum_zip_extra3=$sum_zip_extra3+1;
$deg_zip_extra3="zip_extra3";
$url_zip_extra3="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra3/$type[1]";
$url_zip_extra3 = "/amAze/jad.php?url=" . urlencode($url_zip_extra3);
$url_zip_extra3_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra3";
$url_zip_extra3_Size=STORAGE_ROOT.$url_zip_extra3_Size;
$url_zip_extra3_Size=findSizeFile_sum('',$url_zip_extra3_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_zip_extra3=$session_id."_zip_extra3.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra3";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_zip_extra3 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_zip_extra3&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_zip_extra3 .="&session_id_blackberry=$session_id_blackberry_zip_extra3&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
If (($Has_Another_Version->Has_Another_Version & 32768) == 32768)
{
$container = $device_params->file_name_zip;
if(strstr($container,$string1))
{
$type = explode("\\", $newFolder_zip);
}
else
{
$type = explode("/", $newFolder_zip);
}
$sum_zip_extra4=$sum_zip_extra4+1;
$deg_zip_extra4="zip_extra4";
$url_zip_extra4="/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra4/$type[1]";
$url_zip_extra4 = "/amAze/jad.php?url=" . urlencode($url_zip_extra4);
$url_zip_extra4_Size="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$type[0]_extra4";
$url_zip_extra4_Size=STORAGE_ROOT.$url_zip_extra4_Size;
$url_zip_extra4_Size=findSizeFile_sum('',$url_zip_extra4_Size);
$device_name_blackBerry = explode(" ", $device_name);
$device_name_blackBerry=$device_name_blackBerry[0];
$session_id=session_id();
$session_id_blackberry_zip_extra4=$session_id."_zip_extra4.txt";
if($device_name_blackBerry=="BlackBerry")
{
$brand=BRAND;
$deg_cod="cod";
$typeFile = explode(".",$newFolder);
$typeFile=$typeFile[0];
$url_code = "/data/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile.$deg_cod";
$typeFile = explode("/",$typeFile);
$url_Size_code="/$device_params->app_version_name/$device_params->app_type/$device_params->version/$typeFile[0]_extra4";
$url_Size_code=STORAGE_ROOT.$url_Size_code;
$url_Size_code=findSizeFile('cod',$url_Size_code);
$replace=STORAGE_ROOT;
$with="data";
$url_Size_code = str_replace($replace, $with, $url_Size_code);
if($device_params->app_type!="amAze")
{
$url_zip_extra4 .="&session_id_blackberry=$device_params->app_type/$session_id_blackberry_zip_extra4&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
else
{
$url_zip_extra4 .="&session_id_blackberry=$session_id_blackberry_zip_extra4&brand=$brand&token=$g_token&url_Size_code=$url_Size_code";
}
}
}
}
$sqlqry_download = "select is_download from devices where device_id='$g_device_id'";
$rs_download = mt_odbc_exec($conn, $sqlqry_download);
$download = odbc_fetch_object($rs_download);
if ($download->is_download!="false")
{
$lastName = $device_params->file_name;
$lastName = explode(".", $lastName);
if($lastName[1]=="jad")
{
$url = "/amAze/jad.php?url=" .$url;
}
$lastName[1]="[".$lastName[1]."]";
$lastName_zip = $device_params->file_name_zip;
$lastName_zip = explode(".", $lastName_zip);
$lastName_zip[1]="[".$lastName_zip[1]."]";
$device_name_wm = explode(" ", $device_name);
$device_name_wm=$device_name_wm[0];
$typeFile = explode("/",$newFolder);
$nameFile=$typeFile[1];
$typeFile=$typeFile[0];
$app_version_name=$device_params->app_version_name;
$app_type=$device_params->app_type;
$version=$device_params->version;
//this happend when the device is type:windows_mobile
if($device_params->is_windows_mobile==1)
{
$theme=THEME;
$user_name=strtoupper($user_details["user_name"]);
$user_password=strtoupper($user_details["password"]);
$url = "/amAze/cabFile.php?app_version_name=$app_version_name&app_type=$app_type&version=$version&folder=$newFolder&user_name=$user_name&user_password=$user_password&theme=$theme&valueIdProject=amAzeGPSjad.ini";
$typeFile=$typeFile."_signed";
$newFolder=$typeFile."/".$nameFile;
$url_Signed = "/amAze/cabFile.php?app_version_name=$app_version_name&app_type=$app_type&version=$version&folder=$newFolder&user_name=$user_name&user_password=$user_password&theme=$theme&valueIdProject=amAzeGPSjad.ini";
$typeFile=$typeFile."_other";
$newFolder=$typeFile."/".$nameFile;
$url_other = "/amAze/cabFile.php?app_version_name=$app_version_name&app_type=$app_type&version=$version&folder=$newFolder&user_name=$user_name&user_password=$user_password&theme=$theme&valueIdProject=amAzeGPSjad.ini";
}
?>
//print all links?>
=$DOWNLOAD_MOBILE?> - =$STRING_DOWNLOAD?> =$STRING_FOR_THE?> =$device_name?> =$lastName[1]?> ="("?>1){ printf("%.0f",$url_Size);?> ="KB)"?>}else {printf("%.0f",$url_Size);?> ="bytes)"?>}?>}?>
=$STRING_OR?>
}?>=$DOWNLOAD_MOBILE?> - =$STRING_DOWNLOAD_SIGNED?> =$STRING_FOR_THE?> =$device_name?> =$lastName[1]?> ="("?>1){ printf("%.0f",$url_Signed_Size);?> ="KB)"?>}else {printf("%.0f",$url_Signed_Size);?> ="bytes)"?>}?>};if(($sum_jad==1 || $sum_Signed==1)&& $sum_other==1){?>
=$STRING_OR?>
} if($deg_other=="other"){?>=$DOWNLOAD_MOBILE?> - =$STRING_DOWNLOAD_OTHER?> =$JAD_FILE_OTHER?> =$STRING_OF ?> =$STRING_FOR_THE?> =$device_name?> =$lastName[1]?> ="("?>1){ printf("%.0f",$url_other_Size);?> ="KB)"?>}else {printf("%.0f",$url_other_Size);?> ="bytes)"?>}?>};?>
=$STRING_OR?>
}?>=$DOWNLOAD_PC?> - =$DOWNLOAD_AMAZE?> =$lastName_zip[1]?> ="("?>1){ printf("%.0f",$url_zip_Size);?> ="KB)"?>}else {printf("%.0f",$url_zip_Size);?> ="bytes)"?>}?>} if(($sum_jad==1 || $sum_Signed==1 || $sum_other==1 || $sum_zip==1) && $sum_zip_signed==1){?>
=$STRING_OR?>
} if($deg_zip_signed=="zip_signed"){?>=$DOWNLOAD_PC?> - =$DOWNLOAD_SIGNED_AMAZE?>=$lastName_zip[1]?> ="("?>1){ printf("%.0f",$url_Signed_zip_Size);?> ="KB)"?>}else {printf("%.0f",$url_Signed_zip_Size);?> ="bytes)"?>}?>}; if(($sum_jad==1 || $sum_Signed==1 || $sum_other==1 || $sum_zip==1 || $sum_zip_signed==1) && $sum_zip_other==1){?>
=$STRING_OR?>
}if($deg_zip_other=="zip_other"){?> =$DOWNLOAD_PC?> - =$STRING_DOWNLOAD_OTHER?> =$JAD_FILE_OTHER?> =$STRING_OF ?> =$DOWNLOAD_OTHER ?> =$lastName_zip[1]?> ="("?>1){ printf("%.0f",$url_other_zip_Size);?> ="KB)"?>}else {printf("%.0f",$url_other_zip_Size);?> ="bytes)"?>}?>};?>
}
if (!is_null($device_params->device_comment) && !empty($device_params->device_comment))
{
$connectionInfo = array("UID" => "sa", "PWD" => "qwe123", "Database"=>"LNDownloads");
$conn = sqlsrv_connect( "192.168.0.220", $connectionInfo);
$tsql="select device_comment,device_comment_more,device_comment_more2 from vu_apps_devices where app_version_name = '$g_app_version_name'" .
"AND public_name='$g_app_public_name' " .
"AND device_id='$device_params->device_id' ";
$stmt = sqlsrv_query($conn, $tsql);
if ($stmt === false)
{
echo "Error in query preparation/execution.\n";
die( print_r( sqlsrv_errors(), true));
}
// Prepare the statement.
$stmt = sqlsrv_prepare($conn, $tsql);
// Execute the statement.
sqlsrv_execute( $stmt);
//Retrieve each row as a PHP object and display the results.
while( $obj = sqlsrv_fetch_object( $stmt))
{
$device_comment=$obj->device_comment;
$device_comment_more=$obj->device_comment_more;
$device_comment_more2=$obj->device_comment_more2;
}
?>=utf8_encode($device_comment);?> =utf8_encode($device_comment_more);?> =utf8_encode($device_comment_more2);?>
// close the connection
// mssql_close($dbhandle);
}
?>
=$DOWNLOAD6?>
$thisVendor=$_SESSION['thisVendor'];
$thisVendor = str_replace(" ", "_", $thisVendor);
$url = add_token_to_url("/amAze/maporama/genIndex.php?vendor=$thisVendor", $g_token);
if($thisVendor=="")
{
$url = add_token_to_url("/amAze/maporama?vendor=all°=deg", $g_token);
}
$http= $_SERVER['REQUEST_URI'];
if($degel==1 && $_SESSION['deg']!=2)
{
$url = add_token_to_url("/amAze/maporama/genIndex.php?vendor=all°=deg", $g_token);
}
?>=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_DEVICE?>.
if ($device_params->is_public)
{
$url = add_token_to_url("/amAze/maporama/genIndex.php", $g_token);
?>=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_APPLICATION?>.
}
}
else // can't choose device
{
header("location: $url");
}
}
}
//this if execute on the page vendors
else if (isset($g_app_public_name) && !empty($g_app_public_name)) // no device id, show decvices menu
{
$http= $_SERVER['REQUEST_URI'];
if($_REQUEST['vendor']=="all" || $_REQUEST['vendor']=="" && $device_per_vendoer==false)
{
if (strpos($http,"deg")!=false)
{
$_SESSION['deg']=2;
}
$sqlqry = "SELECT * FROM vu_apps_versions WHERE app_version_name = '$g_app_version_name' AND public_name = '$g_app_public_name'";
$rs = odbc_exec($conn, $sqlqry);
$app = odbc_fetch_object($rs);?>
|
| =$DOWNLOAD2?> |
|
| =$DOWNLOAD3?> |
|
| =$DOWNLOAD4?> |
|
|
$sqlqry = "select * from vu_apps_devices where app_version_name = '$g_app_version_name'" .
"AND public_name='$g_app_public_name' " .
"ORDER BY make, model";
$rs = odbc_exec($conn, $sqlqry);
$device_params = odbc_fetch_object($rs);
$devices = get_vendors_array(6,$version_id,$type_id);
foreach ($devices as $vendor=>$models)
{
$vendor_link = str_replace(" ", "_", $vendor);
$url = add_token_to_url("/amAze/maporama/genIndex.php?vendor=$vendor_link", $g_token);
?>
}?>
|
|
| =$DOWNLOAD5?> |
}
else
{
$sqlqry = "select * from vu_apps_devices where app_version_name = '$g_app_version_name' " .
"AND public_name='$g_app_public_name' " .
"AND device_id='$userAgent' ";
// try to automatically identify device
$rs = mt_odbc_exec($conn, $sqlqry);
$device_params = odbc_fetch_object($rs);
if ( $device_params &&
( !isset($g_device_id)
|| (isset($g_device_id)
&& $g_device_id == 'all')))
{
$url = add_token_to_url("/amAze/maporama/genIndex.php?device_id=$device_params->device_id", $g_token);
//header("location: $url.$classMaporama");
}
else // device not recognized, display list of devices
{
$sqlqry = "SELECT * FROM vu_apps_versions WHERE app_version_name = '$g_app_version_name' AND public_name = '$g_app_public_name'";
$rs = mt_odbc_exec($conn, $sqlqry);
$app = odbc_fetch_object($rs);
if ($app->can_choose_device) // show list of available devices
{
if($device_per_vendoer!=true || $_REQUEST['vendor']!=null)
{
$vendor_new=$_REQUEST['vendor'];
$vendor_new = str_replace("_", " ", $vendor_new);
}
$_SESSION['thisVendor']=$vendor_new;
$sqlqry = "select * from vu_apps_devices where app_version_name = '$g_app_version_name'" .
"AND public_name='$g_app_public_name' and make='$vendor_new' " .
"ORDER BY make, model";
$rs = mt_odbc_exec($conn, $sqlqry);
$displayed_comment = false;
while ($device_params = odbc_fetch_object($rs))
{
if ( !is_null($device_params->download_comment)
&& !empty($device_params->download_comment)
&& !$displayed_comment)
{
?>=mb_convert_encoding($device_params->download_comment, "UTF-8", "ISO-8859-8")?>
}
if (!$displayed_comment)
{
?>
=$STRING_CHOOSE_DEVICE?>
|
$displayed_comment = true;
}
$url = add_token_to_url("/amAze/maporama/genIndex.php?device_id=$device_params->device_id", $g_token);
$url_new = add_token_to_url("/amAze/maporama/genIndex.php?vendor=all", $g_token);
$device_name = $device_params->make . ' ' . $device_params->model;
?>
}
?> |
|
|
|
|
|
?>=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_VENDOR?>.
?> |
$sqlqry = "select * from vu_apps_versions where app_version_name = '$g_app_version_name'";
$rs = mt_odbc_exec($conn, $sqlqry);
$app = odbc_fetch_object($rs);
//var_dump( $app);
/* select diffrent application if (odbc_num_rows($rs) > 1)
{
$url = add_token_to_url("/amAze/maporama", $g_token);
?>
=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_APPLICATION?>.
}
else if ($app->is_public)
{
$url = add_token_to_url("/amAze/maporama/", $g_token);
?>
=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_VERSION?>.
}*/
}
else // send "device unsupported" message
{
?>
=$STRING_DEVICE_UNSUPPORTED_PREFIX?> =$userAgent?>=$STRING_DEVICE_UNSUPPORTED_SUFFIX?>
}
}
}
}
else if (isset($g_app_version_name) && !empty($g_app_version_name)) // no app type (amAze 2.0, amAze 3.0, etc), show types menu
{
//?>=$STRING_CHOOSE_APP?>
$sqlqry = "select * from vu_apps_versions where app_version_name = '$g_app_version_name'";
$rs = mt_odbc_exec($conn, $sqlqry);
if (odbc_num_rows($rs) == 0)
{
?>No version named =$g_app_version_name?>.
} else
while ($app_types = odbc_fetch_object($rs))
{
$url = add_token_to_url("/amAze/maporama/genIndex.php", $g_token);
?>=$app_types->app_type . ' ' . $app_types->version?>
}
$sqlqry = "select * from app_versions where app_version_name = '$g_app_version_name'";
$rs = mt_odbc_exec($conn, $sqlqry);
$app = odbc_fetch_object($rs);
if ($app->is_public)
{
$url = add_token_to_url("/amAze/maporama/genIndex.php/", $g_token);
?>
=$STRING_SELECT_A?> =$STRING_DIFFERENT?> =$STRING_VERSION?>.
}
}
else // no app version (Orange, Vodafone, etc), show versions menu
{
//?>=$STRING_CHOOSE_APP?>
$sqlqry = "SELECT * FROM vu_versions_with_devices WHERE is_public=1";
$rs = mt_odbc_exec($conn, $sqlqry);
while ($app_version = odbc_fetch_object($rs))
{
$url = add_token_to_url("/amAze/maporama/genIndex.php/", $g_token);
?>=$app_version->app_description?>
}
}
?>