<?php
/************************************
Script : Adnetwork
Website : http://facebook.com/pranto007
Script is created and provided by Pranto (http://facebook.com/pranto007)
**************************************/
include '../db.php';
include '../functions.php';
headtag("$SiteName - Update Uc Report");
if($adminlog==1){
$id=formget("id");
$yesterday=date("Y-m-d", time()-86400);
$n1=rand(1,10);
$n2=rand(1,10);
echo '<div class="title">Add Ucweb Report</div>';
{
if(isset($_POST["user"]) AND isset($_POST["date"]) AND isset($_POST["appsindo"]) AND isset($_POST["java"]) AND isset($_POST["in"]) AND isset($_POST["id"]) AND isset($_POST["bd"]) AND isset($_POST["my"]) AND isset($_POST["vn"]) AND isset($_POST["br"]) AND isset($_POST["ru"]) AND isset($_POST["other"]) AND isset($_POST["hotvideo"]) AND isset($_POST["mobilemoney"]) AND isset($_POST["vidmate"]) AND isset($_POST["phonebooster"])){
$user=formpost("user");
$rdate=formpost("date");
$apps=formpost("apps");
$appsindo=formpost("appsindo");
$appsbd=formpost("appsbd");
$appspk=formpost("appspk");
$java=formpost("java");
$in=formpost("in");
$id=formpost("id");
$bd=formpost("bd");
$my=formpost("my");
$vn=formpost("vn");
$br=formpost("br");
$ru=formpost("ru");
$other=formpost("other");
$apus='0';
$hotvideo='0';
$aliexpress='0';
$mobilemoney=formpost("mobilemoney");
$vidmate=formpost("vidmate");
$phonebooster=formpost("phonebooster");
$date=str_replace("/",'-',$rdate);
$querydata=mysql_query("select * from ucreport where date='$date' And user='$user'");
$errors=array();
if(strlen($user)<1){
$errors[]='User Name Cannot Be Empty!';
}
if(strlen($rdate)<1){
$errors[]='Date Cannot Be Empty!';
}
if(strlen($apps)<1){
$errors[]='9Apps India Installs Cannot Be Empty!';
}
if(strlen($appsindo)<1){
$errors[]='9Apps Indonesia Installs Cannot Be Empty!';
}
if(strlen($appsbd)<1){
$errors[]='9Apps Bangladesh Installs Cannot Be Empty!';
}
if(strlen($appspk)<1){
$errors[]='9Apps Pakistan Installs Cannot Be Empty!';
}
if(strlen($java)<1){
$errors[]='Java Installs Cannot Be Empty!';
}
if(strlen($in)<1){
$errors[]='India Installs Cannot Be Empty!';
}
if(strlen($id)<1){
$errors[]='Indonesia Installs Cannot Be Empty!';
}
if(strlen($bd)<1){
$errors[]='Bangladesh Installs Cannot Be Empty!';
}
if(strlen($my)<1){
$errors[]='Malaysia Installs Cannot Be Empty!';
}
if(strlen($vn)<1){
$errors[]='Vietnam Installs Cannot Be Empty!';
}
if(strlen($br)<1){
$errors[]='Brazil Installs Cannot Be Empty!';
}
if(strlen($ru)<1){
$errors[]='Russia Installs Cannot Be Empty!';
}
if(strlen($other)<1){
$errors[]='Others Installs Cannot Be Empty!';
}
if(strlen($hotvideo)<1){
$errors[]='HotVideo Installs Cannot Be Empty!';
}
if(strlen($mobilemoney)<1){
$errors[]='Mobile Money Installs Cannot Be Empty!';
}
if(strlen($vidmate)<1){
$errors[]='Vidmate Installs Cannot Be Empty!';
}
if(strlen($phonebooster)<1){
$errors[]='Phonebooster Installs Cannot Be Empty!';
}
if(mysql_num_rows($querydata) > 0)
{
$errors[]="This Date Report Is Already Added";
}
$year=date("Y");
$month=date("m-Y");
$month1=date("m");
$mnth="";
if($month1=="01")
{
$mnth="January";
}
else if($month1=="02")
{
$mnth="February";
}
else if($month1=="03")
{
$mnth="March";
}
else if($month1=="04")
{
$mnth="April";
}
else if($month1=="05")
{
$mnth="May";
}
else if($month1=="06")
{
$mnth="June";
}
else if($month1=="07")
{
$mnth="July";
}
else if($month1=="08")
{
$mnth="August";
}
else if($month1=="09")
{
$mnth="September";
}
else if($month1=="10")
{
$mnth="October";
}
else if($month1=="11")
{
$mnth="November";
}
else if($month1=="12")
{
$mnth="December";
}
if(empty($errors)){
$doit=mysql_query("INSERT INTO ucreport (user, month, date, apps, appsindo, appsbd, appspk, java, india, indo, bd, my, vn, br, ru, other, apus, hotvideo, mobilemoney, aliexpress, vidmate, phonebooster)
VALUES ('$user', '$mnth,$year', '$date', '$apps', '$appsindo', '$appsbd', '$appspk', '$java', '$in', '$id', '$bd', '$my', '$vn', '$br', '$ru', '$other', '$apus', '$hotvideo', '$mobilemoney', '$aliexpress', '$vidmate', '$phonebooster')");
$select = mysql_query("SELECT * FROM userdata WHERE username='$user'");
$arshad = mysql_fetch_array($select);
$ucbalance=$arshad["ucbalance"];
$aapps=$apps*$appsprice;
$aappsindo=$appsindo*$appsindoprice;
$aappsbd=$appsbd*$appsbdprice;
$aappspk=$appspk*$appspkprice;
$ajava=$java*$javaprice;
$ain=$in*$indiaprice;
$aid=$id*$indoprice;
$abd=$bd*$bdprice;
$amy=$my*$myprice;
$avn=$vn*$vnprice;
$abr=$br*$brprice;
$aru=$ru*$ruprice;
$aother=$other*$otherprice;
$aapus=$apus*$apusprice;
$ahotvideo=$hotvideo*$hotvideoprice;
$amobilemoney=$mobilemoney*$mobilemoneyprice;
$aaliexpress=$aliexpress*$aliexpressprice;
$avidmate=$vidmate*$vidmateprice;
$aphonebooster=$phonebooster*$phoneboosterprice;
$money=$aapps+$aappsindo+$aappsbd+$aappspk+$ajava+$ain+$aid+$abd+$amy+$avn+$abr+$aru+$aother+$aapus+$ahotvideo+$aother+$amobilemoney+aaliexpress+$avidmate+$aphonebooster;
$ucbal=$ucbalance+$money;
$bal=mysql_query("UPDATE userdata SET ucbalance='$ucbal' WHERE username='$user'");
if($doit AND $bal){
echo '<div class="success">'.$user.' Report Added!</div>';
}
else {
echo '<div class="error">Error adding report!</div>';
}
}
else {
dump_error($errors);
}
}
$tot=($n1+$n2);
echo '<div class="form"><form method="post">Username<br/><input type="text" name="user" value="'.$id.'"/><br/>Date<br/><input type="text" name="date" value="'.$yesterday.'"/><br/>9Apps India Installs<br/><input type="number" name="apps"/><br/>9Apps Indonesia Installs<br/><input type="number" name="appsindo"/><br/>9Apps Bangladesh Installs<br/><input type="number" name="appsbd"/><br/>9Apps Pakistan Installs<br/><input type="number" name="appspk"/><br/>Java Installs<br/><input type="number" name="java"/><br/>India Installs<br/><input type="number" name="in"/><br/>Indonesia Installs<br/><input type="number" name="id"/><br/>Banglaesh Installs<br/><input type="number" name="bd"/><br/>Malaysia Installs<br/><input type="number" name="my"/><br/>Vietnam Installs<br/><input type="number" name="vn"/><br/>Brazil Installs<br/><input type="number" name="br"/><br/>Russia Installs<br/><input type="number" name="ru"/><br/>Others Installs<br/><input type="number" name="other"/><br/>HotVideo Installs<br/><input type="number" name="hotvideo"/><br/>Mobile Money Installs<br/><input type="number" name="mobilemoney"/><br/>Vidmate Installs<br/><input type="number" name="vidmate"/><br/>Phonebooster Installs<br/><input type="number" name="phonebooster"/><br/><input type="submit" value="Add Now"/></form></div>';
}
echo '<a href="ucreport.php"><div class="ua">Reports</div></a>';
include '../foot.php';
}
else {
header('Location:login.php');
}
?>