Beispiel #1
0
function monthName()
{
    ?>
	   <select id="addAgeMonth"> 
       <option>...</option>
	<?php 
    for ($x = 1; $x <= 12; $x++) {
        $id = numberToMonth($x);
        ?>
        <option name= "<?php 
        echo $x;
        ?>
" > <?php 
        echo $id;
        ?>
 </option>
        <?php 
    }
    ?>
	</select>
	<?php 
}
Beispiel #2
0
 //loop through each month
 $monthArray = array();
 $queryMonthArray = array();
 $queryMonthArray = explode(",", $statArray['months']);
 //we need to eliminate duplicates - mysql doesnt allow group inside group_concats
 foreach ($queryMonthArray as $resultMonth) {
     $infoArray = array();
     $infoArray = explode("|", $resultMonth);
     $monthArray[$infoArray[0]] = $infoArray[1];
 }
 foreach ($monthArray as $month => $outlier) {
     echo "<tr id='tr_" . $platformID . "_" . $publisherPlatformID . "_" . $statArray['year'] . "_" . $month . "_" . $statArray['archiveInd'] . "'>";
     echo "<td style='padding:0px;'>";
     echo "<table class='noBorderTable' style='width:340px;'>";
     echo "<tr>";
     echo "<td style='width:70px;font-weight:bold;'>" . numberToMonth($month) . " " . $statArray['year'] . "</td>";
     echo "<td><a href=\"javascript:deleteMonth('" . $statArray['resourceType'] . "','" . $month . "','" . $statArray['year'] . "','" . $statArray['archiveInd'] . "', '" . $publisherPlatformID . "', '" . $platformID . "')\" style='font-size:100%;'>delete entire month</a>";
     //print out prompt for outliers if outlierID is > 0
     if ($outlier > 0) {
         echo "&nbsp;&nbsp;<a href='ajax_forms.php?action=getMonthlyOutlierForm&publisherPlatformID=" . $publisherPlatformID . "&platformID=" . $platformID . "&archiveInd=" . $statArray['archiveInd'] . "&month=" . $month . "&year=" . $statArray['year'] . "&resourceType=" . $statArray['resourceType'] . "&height=340&width=415&modal=true' class='thickbox' style='font-size:100%;'>view outliers for this month</a>";
     }
     echo "</td></tr>";
     echo "</table>";
     echo "</td>";
     echo "</tr>";
 }
 if ($config->settings->useOutliers == "Y") {
     echo "<tr>";
     echo "<td><span style='font-weight:bold;'>YTD " . $statArray['year'] . "</span>";
     if ($statArray['outlierID'] > 0) {
         echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href='ajax_forms.php?action=getYearlyOverrideForm&resourceType=" . $statArray['resourceType'] . "publisherPlatformID=" . $publisherPlatformID . "&platformID=" . $platformID . "&archiveInd=" . $statArray['archiveInd'] . "&year=" . $statArray['year'] . "&height=340&width=415&modal=true' class='thickbox' style='font-size:100%;'>update overrides for this year</a>";
Beispiel #3
0
<div id="div_stats">
<table border="0" style="width:480px">
<?php 
if ($publisherPlatformID) {
    $result = mysql_query("select distinct year, month, archiveInd from title_stats_monthly where publisherPlatformID='" . $publisherPlatformID . "' order by year, archiveInd, month;");
} else {
    $result = mysql_query("select distinct year, month, archiveInd from title_stats_monthly tsm, publisher_platform pp where pp.publisherPlatformID = tsm.publisherPlatformID and pp.platformID = '" . $platformID . "' order by year, archiveInd, month;");
}
while ($row = mysql_fetch_assoc($result)) {
    if ($row['archiveInd'] == "1") {
        $archive = 'Archive';
    } else {
        $archive = '';
    }
    echo "<tr>";
    echo "<td style='width:80px'><b>" . numberToMonth($row['month']) . " " . $row['year'] . "</b><br />" . $archive . "</td>";
    echo "<td style='width:200px'><a href=\"javascript:deleteMonth('" . $row['month'] . "','" . $row['year'] . "','" . $row['archiveInd'] . "')\">delete entire month</a></td>";
    //monthly ouliers
    if ($publisherPlatformID) {
        $query = "select *\r\n\t\t\tfrom title_stats_monthly tsm\r\n\t\t\twhere outlierID <> 0 and publisherPlatformID='" . $publisherPlatformID . "'\r\n\t\t\tand archiveInd='" . $row['archiveInd'] . "'\tand year='" . $row['year'] . "'\tand month='" . $row['month'] . "' and ignoreOutlierInd = 0;";
    } else {
        $query = "select tsm.*\r\n\t\t\tfrom title_stats_monthly tsm, publisher_platform pp\r\n\t\t\twhere tsm.publisherPlatformID = pp.publisherPlatformID and outlierID <> 0 and platformID='" . $platformID . "'\r\n\t\t\tand archiveInd='" . $row['archiveInd'] . "'\tand year='" . $row['year'] . "'\tand month='" . $row['month'] . "' and ignoreOutlierInd = 0;";
    }
    $outlier_result = mysql_query($query);
    if (mysql_num_rows($outlier_result) != 0) {
        echo "<td style='width:200px'><a href=\"javascript:popUp('outliers.php?publisherPlatformID=" . $publisherPlatformID . "&platformID=" . $platformID . "&archiveInd=" . $row['archiveInd'] . "&month=" . $row['month'] . "&year=" . $row['year'] . "');\">view outliers for this month</a></td>";
    } else {
        echo "<td style='width:200px'>&nbsp;</td>";
    }
    echo "</tr>";
    #figure out if this is the max row to print the YTD
Beispiel #4
0
    public function getSaveAge()
    {
        $this->setRquery("SELECT pDOBD,pDOBM,pDOBY  FROM amistiPersonal WHERE userID=?", array($this->UID));
        $res = $this->getRquery();
        $id = $this->UID;
        $age = getUserAge($res[0]['pDOBD'], $res[0]['pDOBM'], $res[0]['pDOBY']);
        $age .= " years";
        $birthD .= addZero($res[0]['pDOBD']) . " " . numberToMonth($res[0]['pDODM']);
        $ageInfo = $this->UID == UID ? "Your age information:" : $this->uName . " age information:";
        ?>
				<div class="pProfileICHeader"> <?php 
        echo $ageInfo;
        ?>
</div>
				<?php 
        if ($this->UID == UID) {
            //check if it same as cur user
            ?>
				<div class="pProfileMenuShow">...</div>
				<!--- menu -->
				<div class="pProfileMenu">
				<li id="ageEdit">Edit</li>
				<li id="ageDelete">Delete</li>
				</div>
				<?php 
        }
        ?>
				<div class="pProfileItem">
                <table> 
                <tr><td>Date of Birth </td><td>: <?php 
        echo $birthD;
        ?>
</td></tr>
				<tr><td> Age </td><td>: <?php 
        echo $age;
        ?>
 </td></tr>
               </table>
               
                </div>

				<?php 
    }
function generateNumberPatientReport($conn)
{
    global $gTEXT;
    require_once 'tcpdf/tcpdf.php';
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->AddPage();
    $pdf->SetFillColor(255, 255, 255);
    //=====================================================National Inventory Table=======================================================
    $monthId = $_POST['MonthId'];
    $year = $_POST['YearId'];
    $countryId = $_POST['CountryId'];
    $itemGroupId = $_POST['ItemGroupId'];
    $currentYearMonth = $_POST['YearId'] . "-" . $_POST['MonthId'] . "-" . "01";
    $monthList = array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
    $sql = " SELECT ItemName, AMC, ClStock, FORMAT(MOS,1) MOS, Qty StockOnOrder, FORMAT(Qty/AMC,1) StockOnOrderMOS,\n                     (ifnull(FORMAT(MOS,1),0)+ifnull(FORMAT(Qty/AMC,1),0)) TotalMOS,a.ItemNo,TotalPatient\n                     FROM \n        \t\t\t\t(SELECT\n        \t\t\t\t t_cnm_masterstockstatus.CountryId,\n        \t\t\t\t  t_itemlist.ItemNo,\n        \t\t\t\t  t_itemlist.ItemName,\n        \t\t\t\t  SUM(t_cnm_stockstatus.AMC)    AMC,\n        \t\t\t\t  SUM(t_cnm_stockstatus.ClStock)    ClStock,\n        \t\t\t\t  SUM(t_cnm_stockstatus.MOS)    MOS\n        \t\t\t\tFROM t_cnm_stockstatus\n        \t\t\t\t  INNER JOIN t_cnm_masterstockstatus\n        \t\t\t\t    ON (t_cnm_stockstatus.CNMStockId = t_cnm_masterstockstatus.CNMStockId)\n        \t\t\t\t  INNER JOIN t_itemlist\n        \t\t\t\t    ON (t_cnm_stockstatus.ItemNo = t_itemlist.ItemNo)\n        \t\t\t\tWHERE (t_cnm_masterstockstatus.Year = '{$year}'\n        \t\t\t\t       AND t_cnm_masterstockstatus.MonthId ={$monthId}\n        \t\t\t\t       AND t_cnm_masterstockstatus.CountryId = {$countryId}\n        \t\t\t\t       AND t_cnm_masterstockstatus.ItemGroupId ={$itemGroupId}\n        \t\t\t\t       AND t_cnm_masterstockstatus.StatusId = 5)\n        \t\t\t\tGROUP BY t_cnm_masterstockstatus.CountryId, t_itemlist.ItemNo, t_itemlist.ItemName) a \n        \t\t\t\tLEFT JOIN (SELECT\n        \t\t\t\t    CountryId\n        \t\t\t\t    , ItemNo\n        \t\t\t\t    , SUM(Qty) Qty\n        \t\t\t\tFROM\n        \t\t\t\t    t_agencyshipment\n        \t\t\t\tWHERE (ShipmentDate > CAST('{$currentYearMonth}' AS DATETIME)  AND ShipmentStatusId = 3)\n        \t\t\t\tGROUP BY CountryId, ItemNo) b\n        \t\t\t\tON a.CountryId = b.CountryId AND a.ItemNo = b.ItemNo\n        \t\t\t\tLEFT JOIN (SELECT t_cnm_regimenpatient.CountryId,ItemNo,sum(TotalPatient) as TotalPatient\n        \t\t\t\tfrom t_cnm_regimenpatient\n        \t\t\t\tInner Join t_regimenitems ON t_cnm_regimenpatient.RegimenId=t_regimenitems.RegimenId\n        \t\t\t\tGroup By t_cnm_regimenpatient.CountryId,ItemNo) c ON a.CountryId = c.CountryId AND a.ItemNo = c.ItemNo\n        \t\t\t\t\n        \t\t\t\tHAVING MOS>0 OR StockOnOrderMOS>0 \n        \t\t\t\t;";
    $result = mysql_query($sql, $conn);
    $total = mysql_num_rows($result);
    if ($total > 0) {
        $data = array();
        $f = 0;
        $tblHTML = '';
        while ($rec = mysql_fetch_array($result)) {
            $addmonth = number_format($rec['TotalMOS']);
            $currentYearMonth = $year . "-" . $monthId . "-" . "01";
            $lastYearMonth = date("Y-m-d", strtotime(date("Y-m-d", strtotime($currentYearMonth)) . "{$addmonth} month"));
            $temp = explode('-', $lastYearMonth);
            $strMonth = numberToMonth($temp[1]);
            $lastYearMonth = $strMonth . ', ' . $temp[0];
            $data['SL'][$f] = $f;
            $data['ItemName'][$f] = $rec['ItemName'];
            $data['TotalPatient'][$f] = $rec['TotalPatient'] == 0 ? '' : number_format($rec['TotalPatient']);
            $data['ClStock'][$f] = $rec['ClStock'] == 0 ? '' : number_format($rec['ClStock']);
            $data['MOS'][$f] = $rec['MOS'] == 0 ? '' : number_format($rec['MOS'], 1);
            $data['StockOnOrder'][$f] = $rec['StockOnOrder'] == 0 ? '' : number_format($rec['StockOnOrder']);
            $data['StockOnOrderMOS'][$f] = $rec['StockOnOrderMOS'] == 0 ? '' : number_format($rec['StockOnOrderMOS'], 1);
            $data['TotalMOS'][$f] = $rec['TotalMOS'] == 0 ? '' : number_format($rec['TotalMOS'], 1);
            $tblHTML .= '<tr style="page-break-inside:avoid;">
                            <td align="center" width="30" valign="middle">' . ($data['SL'][$f] + 1) . '</td>  
                            <td align="left" width="150" valign="middle">' . $data['ItemName'][$f] . '</td>
                            <td align="right" width="60" valign="middle">' . $data['TotalPatient'][$f] . '</td>
                            <td align="right" width="60" valign="middle">' . $data['ClStock'][$f] . '</td>
                            <td align="right" width="85" valign="middle">' . $data['MOS'][$f] . '</td>
                            <td align="right" width="60" valign="middle">' . $data['StockOnOrder'][$f] . '</td>
                            <td align="right" width="80" valign="middle">' . $data['StockOnOrderMOS'][$f] . '</td>
                            <td align="right" width="60" valign="middle">' . $data['TotalMOS'][$f] . '</td>
                            <td align="right" width="80" valign="middle">' . $lastYearMonth . '</td>
                            
                    </tr>';
            $f++;
        }
        $year = $_POST['YearId'];
        $MonthName = $_POST['MonthName'];
        $CountryName = $_POST['CountryName'];
        $html = '
        <!-- EXAMPLE OF CSS STYLE -->
        <style>
        </style>
        <body>
            <h4 style="text-align:center;"><b>' . $gTEXT['Number of Patients by Product Report of '] . '  ' . $CountryName . ' on ' . $MonthName . ',' . $year . '</b></h4>
        </body>';
        $pdf->SetFont('dejavusans', '', 10);
        $pdf->writeHTMLCell(0, 0, 8, 10, $html, '', 0, 0, false, 'C', true);
        $html = '
            <!-- EXAMPLE OF CSS STYLE -->
            <style>
             td{
                 height: 6px;
                 line-height:3px;
             }
            </style>
            <body>
            <table width="600px" border="0.5" style="margin:0 auto;">
                <tr>
            		<th width="30" align="center"><b>SL#</b></th>
                    <th width="150" align="left"><b>' . $gTEXT['Product Name'] . '</b></th>
                    <th width="60" align="right"><b>' . $gTEXT['Total Patients'] . '</b></th>
            		<th width="60" align="right"><b>' . $gTEXT['Available Stock'] . '</b></th>
                    <th width="85" align="left"><b>' . $gTEXT['MOS(Available)'] . '</b></th>
                    <th width="60" align="right"><b>' . $gTEXT['Stock on Order'] . '</b></th>
            		<th width="80" align="right"><b>' . $gTEXT['MOS(Ordered)'] . '</b></th>
                    <th width="60" align="left"><b>' . $gTEXT['Total MOS'] . '</b></th>
                    <th width="80" align="right"><b>' . $gTEXT['Projected Date'] . '</b></th>
                    
         	    </tr>' . $tblHTML . '</table></body>';
        $pdf->SetFont('dejavusans', '', 7);
        $pdf->writeHTMLCell(0, 0, 10, 40, $html, '', 1, 1, false, 'L', true);
        $filePath = SITEDOCUMENT . 'administrator/components/com_jcode/source/report/pdfslice/NumberPatientReport.pdf';
        if (file_exists($filePath)) {
            unlink($filePath);
        }
        $pdf->Output('pdfslice/NumberPatientReport.pdf', 'F');
        echo 'NumberPatientReport.pdf';
    } else {
        echo 'Processing Error';
    }
}
$objPHPExcel->getActiveSheet()->getStyle('E6')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('F6')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('G6')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('H6')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('I6')->getFont()->setBold(true);
$sQuery = " SELECT ItemName, AMC, ClStock, FORMAT(MOS,1) MOS, Qty StockOnOrder, FORMAT(Qty/AMC,1) StockOnOrderMOS, (ifnull(FORMAT(MOS,1),0)+ifnull(FORMAT(Qty/AMC,1),0)) TotalMOS\n\t\t\t\t,a.ItemNo,TotalPatient\n\t\t\t\t FROM \n\t\t\t\t(SELECT\n\t\t\t\t t_cnm_masterstockstatus.CountryId,\n\t\t\t\t  t_itemlist.ItemNo,\n\t\t\t\t  t_itemlist.ItemName,\n\t\t\t\t  SUM(t_cnm_stockstatus.AMC)    AMC,\n\t\t\t\t  SUM(t_cnm_stockstatus.ClStock)    ClStock,\n\t\t\t\t  SUM(t_cnm_stockstatus.MOS)    MOS\n\t\t\t\tFROM t_cnm_stockstatus\n\t\t\t\t  INNER JOIN t_cnm_masterstockstatus\n\t\t\t\t    ON (t_cnm_stockstatus.CNMStockId = t_cnm_masterstockstatus.CNMStockId)\n\t\t\t\t  INNER JOIN t_itemlist\n\t\t\t\t    ON (t_cnm_stockstatus.ItemNo = t_itemlist.ItemNo)\n\t\t\t\tWHERE (t_cnm_masterstockstatus.Year = '{$year}'\n\t\t\t\t       AND t_cnm_masterstockstatus.MonthId ={$monthId}\n\t\t\t\t       AND t_cnm_masterstockstatus.CountryId = {$countryId}\n\t\t\t\t       AND t_cnm_masterstockstatus.ItemGroupId ={$itemGroupId}\n\t\t\t\t       AND t_cnm_masterstockstatus.StatusId = 5)\n\t\t\t\tGROUP BY t_cnm_masterstockstatus.CountryId, t_itemlist.ItemNo, t_itemlist.ItemName) a \n\t\t\t\tLEFT JOIN (SELECT\n\t\t\t\t    CountryId\n\t\t\t\t    , ItemNo\n\t\t\t\t    , SUM(Qty) Qty\n\t\t\t\tFROM\n\t\t\t\t    t_agencyshipment\n\t\t\t\tWHERE (ShipmentDate > CAST('{$currentYearMonth}' AS DATETIME)  AND ShipmentStatusId = 3)\n\t\t\t\tGROUP BY CountryId, ItemNo) b\n\t\t\t\tON a.CountryId = b.CountryId AND a.ItemNo = b.ItemNo\n\t\t\t\tLEFT JOIN (SELECT t_cnm_regimenpatient.CountryId,ItemNo,sum(TotalPatient) as TotalPatient\n\t\t\t\tfrom t_cnm_regimenpatient\n\t\t\t\tInner Join t_regimenitems ON t_cnm_regimenpatient.RegimenId=t_regimenitems.RegimenId\n\t\t\t\tGroup By t_cnm_regimenpatient.CountryId,ItemNo) c ON a.CountryId = c.CountryId AND a.ItemNo = c.ItemNo\n\t\t\t\t " . $sWhere . "\n\t\t\t\tHAVING MOS>0 OR StockOnOrderMOS>0 \n\t\t\t\t {$sOrder}\n                {$sLimit} order by ItemNo,ItemName";
$rResult = mysql_query($sQuery);
$i = 1;
$j = 7;
if ($rResult) {
    while ($row = mysql_fetch_array($rResult)) {
        $addmonth = number_format($row['TotalMOS']);
        $currentYearMonth = $year . "-" . $monthId . "-" . "01";
        $lastYearMonth = date("Y-m-d", strtotime(date("Y-m-d", strtotime($currentYearMonth)) . "{$addmonth} month"));
        $temp = explode('-', $lastYearMonth);
        $strMonth = numberToMonth($temp[1]);
        $lastYearMonth = $strMonth . '  , ' . $temp[0];
        $objPHPExcel->getActiveSheet()->SetCellValue('A' . $j, $i)->SetCellValue('B' . $j, $row['ItemName'])->SetCellValue('C' . $j, $row['TotalPatient'] == '' ? '' : number_format($row['TotalPatient']))->SetCellValue('D' . $j, $row['ClStock'] == '' ? '' : number_format($row['ClStock']))->SetCellValue('E' . $j, $row['MOS'] == '' ? '' : number_format($row['MOS'], 1))->SetCellValue('F' . $j, $row['StockOnOrder'] == '' ? '0' : number_format($row['StockOnOrder']))->SetCellValue('G' . $j, $row['StockOnOrderMOS'] == '' ? '0.0' : number_format($row['StockOnOrderMOS'], 1))->SetCellValue('H' . $j, $row['TotalMOS'] == '' ? '' : number_format($row['TotalMOS'], 1))->SetCellValue('I' . $j, $lastYearMonth);
        $objPHPExcel->getActiveSheet()->getStyle('A' . $j . ':A' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
        $objPHPExcel->getActiveSheet()->getStyle('B' . $j . ':B' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
        $objPHPExcel->getActiveSheet()->getStyle('C' . $j . ':C' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
        $objPHPExcel->getActiveSheet()->getStyle('E' . $j . ':E' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
        $objPHPExcel->getActiveSheet()->getStyle('D' . $j . ':D' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
        $objPHPExcel->getActiveSheet()->getStyle('H' . $j . ':H' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
        $objPHPExcel->getActiveSheet()->getStyle('F' . $j . ':F' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
        $objPHPExcel->getActiveSheet()->getStyle('I' . $j . ':I' . $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
        $styleThinBlackBorderOutline = array('borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => 'FF000000'))));
        $objPHPExcel->getActiveSheet()->getStyle('A' . $j . ':A' . $j)->applyFromArray($styleThinBlackBorderOutline);
        $objPHPExcel->getActiveSheet()->getStyle('B' . $j . ':B' . $j)->applyFromArray($styleThinBlackBorderOutline);
        $objPHPExcel->getActiveSheet()->getStyle('C' . $j . ':C' . $j)->applyFromArray($styleThinBlackBorderOutline);
        $objPHPExcel->getActiveSheet()->getStyle('D' . $j . ':D' . $j)->applyFromArray($styleThinBlackBorderOutline);
	<table border="0">
	<?php 
//get (and save in an array) YTD data for display
$arrayYTD = array();
$result = mysql_query("select distinct year from title_stats_ytd where publisherPlatformID='" . $publisherPlatformID . "';");
while ($row = mysql_fetch_assoc($result)) {
    $arrayYTD[$row['year']] = "<tr>";
    $arrayYTD[$row['year']] .= "<td><b>YTD " . $row['year'] . "</b></font></td>";
    $arrayYTD[$row['year']] .= "<td>&nbsp;</td>";
    $arrayYTD[$row['year']] .= "</tr>";
}
mysql_free_result($result);
$result = mysql_query("select distinct year, month from title_stats_monthly where publisherPlatformID='" . $publisherPlatformID . "' order by year, month;");
while ($row = mysql_fetch_assoc($result)) {
    echo "<tr>";
    echo "<td><b>" . numberToMonth($row['month']) . " " . $row['year'] . "</b></font></td>";
    echo "<td><a href=\"javascript:deleteMonth('" . $row['month'] . "','" . $row['year'] . "')\">delete entire month</a></td>";
    echo "</tr>";
    //monthly ouliers
    $query = "select titleStatsMonthlyID, title, usageCount, overrideUsageCount, color\r\n\t\t\tfrom title_stats_monthly tsm, title t, outlier o\r\n\t\t\twhere tsm.titleID = t.titleID\r\n\t\t\tand o.outlierID = tsm.outlierID\r\n\t\t\tand publisherPlatformID='" . $publisherPlatformID . "'\r\n\t\t\tand year='" . $row['year'] . "'\r\n\t\t\tand month='" . $row['month'] . "';";
    $outlier_result = mysql_query($query);
    if (mysql_num_rows($outlier_result) != 0) {
        echo "<tr>";
        echo "<td>&nbsp;</td>";
        echo "<td>";
        echo "<div id='div_show_outlier_" . $row['month'] . "_" . $row['year'] . "'>";
        echo "<a href=\"javascript:toggleLayer('div_outlier_" . $row['month'] . "_" . $row['year'] . "','block');javascript:toggleLayer('div_show_outlier_" . $row['month'] . "_" . $row['year'] . "','none')\">view outliers for this month</a>";
        echo "</div>";
        echo "<div id='div_outlier_" . $row['month'] . "_" . $row['year'] . "' style='display:none'>";
        echo "<table border='0'>";
        while ($outlier_row = mysql_fetch_assoc($outlier_result)) {
Beispiel #8
0
 $publisherPlatformID = $_GET['publisherPlatformID'];
 $platformID = $_GET['platformID'];
 $year = $_GET['year'];
 $archiveInd = $_GET['archiveInd'];
 if ($publisherPlatformID) {
     $result = mysql_query("select distinct year, month, archiveInd from title_stats_monthly where publisherPlatformID='" . $publisherPlatformID . "' and year = '" . $year . "' and archiveInd = '" . $archiveInd . "' order by year, archiveInd, month;");
 } else {
     $result = mysql_query("select distinct year, month, archiveInd from title_stats_monthly tsm, publisher_platform pp where pp.publisherPlatformID = tsm.publisherPlatformID and pp.platformID = '" . $platformID . "' and year = '" . $year . "' and archiveInd = '" . $archiveInd . "'  order by year, archiveInd, month;");
 }
 while ($row = mysql_fetch_assoc($result)) {
     if ($row['archiveInd'] == "1") {
         $archive = '&nbsp;(archive)';
     } else {
         $archive = '';
     }
     echo "<label for='month' class='month'><b>" . numberToMonth($row['month']) . " " . $row['year'] . "</b> " . $archive . "</label>";
     echo "<label for='deleteStats' class='deleteStats'><a href=\"javascript:deleteMonth('" . $row['month'] . "','" . $row['year'] . "','" . $row['archiveInd'] . "', '" . $publisherPlatformID . "', '" . $platformID . "')\">delete entire month</a></label>";
     //monthly ouliers
     if ($publisherPlatformID) {
         $query = "select *\r\n\t\t\t\tfrom title_stats_monthly tsm\r\n\t\t\t\twhere outlierID <> 0 and publisherPlatformID='" . $publisherPlatformID . "'\r\n\t\t\t\tand archiveInd='" . $row['archiveInd'] . "'\tand year='" . $row['year'] . "'\tand month='" . $row['month'] . "' and ignoreOutlierInd = 0;";
     } else {
         $query = "select tsm.*\r\n\t\t\t\tfrom title_stats_monthly tsm, publisher_platform pp\r\n\t\t\t\twhere tsm.publisherPlatformID = pp.publisherPlatformID and outlierID <> 0 and platformID='" . $platformID . "'\r\n\t\t\t\tand archiveInd='" . $row['archiveInd'] . "'\tand year='" . $row['year'] . "'\tand month='" . $row['month'] . "' and ignoreOutlierInd = 0;";
     }
     $outlier_result = mysql_query($query);
     if (mysql_num_rows($outlier_result) != 0) {
         echo "<label for='outliers' class='outliers'><a href=\"javascript:popUp('outliers.php?publisherPlatformID=" . $publisherPlatformID . "&platformID=" . $platformID . "&archiveInd=" . $row['archiveInd'] . "&month=" . $row['month'] . "&year=" . $row['year'] . "');\">view outliers for this month</a></label>";
     } else {
         echo "<label for='outliers' class='outliers'>&nbsp;</label>";
     }
     mysql_free_result($outlier_result);
     echo "<br />";