Exemple #1
0
$input_count = $get_input_mb[0];
$input_mb = $get_input_mb[1];
$input_gb = $input_mb / 1000;
$gdb_count = $get_input_mb[2];
// total # of databases
$get_update_mb = get_data_total("Update_Data_Path", $dbpass);
// returns ($file_count, $file_size, $n)
$update_count = $get_update_mb[0];
$update_mb = $get_update_mb[1];
$update_gb = $update_mb / 1000;
$get_cpgat_mb = get_data_total("CpGAT_ReferenceProt_File", $dbpass);
// returns ($file_count, $file_size, $n)
$cpgat_count = $get_cpgat_mb[0];
$cpgat_mb = $get_cpgat_mb[1];
$cpgat_gb = $cpgat_mb / 1000;
$get_rep_mask_mb = get_data_total("RepeatMask_File", $dbpass);
// returns ($file_count, $file_size, $n)
$rep_mask_count = $get_rep_mask_mb[0];
$rep_mask_mb = $get_rep_mask_mb[1];
$rep_mask_gb = $rep_mask_mb / 1000;
$count_total = $input_count + $cpgat_count + $update_count + $rep_mask_count;
$mb_total = $input_mb + $cpgat_mb + $update_mb + $rep_mask_mb;
$gb_total = $mb_total / 1000;
$gb_total_display = round($gb_total, 4);
$server = `uname -n |cut -d "." -f 1`;
# identifies this VM
$nodematch = "/(.*)\\.novalocal/";
// this is an OpenStack thing apparently
preg_match($nodematch, $server, $matches);
$server = isset($matches[1]) ? $matches[1] : $server;
$volume_table = "\n\t<table class=\"featuretable\" style=\"width:90%\">\n\t\t<thead>\n\t\t\t<tr class=\"reverse_1\" align='center'>\n\t\t\t\t<th>\n\t\t\t\t\tDirectory Name <br /><span style=\"color:#CCC\">(Click for details)</span>\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\tDynamically Written Contents\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\tSpace Requirement (Option 2)\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\tFree Space (GB) on Partition\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\tFilesystem \n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\tMounted on \n\t\t\t\t</th>\n\t\t\t\t<! th>\n\t\t\t\t\tVolume Location\n\t\t\t\t</th-->\n\t\t\t\t<th>\n\t\t\t\t\tDirectory or Volume Status\n\t\t\t\t</th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr id=\"root\" style=\"background-color:{$color1}\">\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#section1\"><span class=\"plaintext largerfont\">/xGDBvm/</span></a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\tminimal (standard log files, session variables)\n\t\t\t\t</td>\n\t\t\t\t<td align='center' class=\"bold alertnotice\">\n\t\t\t\t\tminimal\n\t\t\t\t</td>\n\t\t\t\t<td align='center' class=\"bold\">\n\t\t\t\t\t{$gb1_display}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$filesys1}</span>'\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$mount1}</span>'\n\t\t\t\t</td>\n\t\t\t\t<! td>\n\t\t\t\t\t{$location1}\n\t\t\t\t</td-->\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"checked\">present</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"input\" style=\"background-color:{$color6}\">\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#section6\"><span class=\"plaintext largerfont\">{$inputDir}</span></a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\tInput data (by user); HPC inputs (temporary); HPC job output (archive/jobs) \n\t\t\t\t</td>\n\t\t\t\t<td align='center' class=\"bold alertnotice\">\n\t\t\t\t\t1x\n\t\t\t\t</td>\n\t\t\t\t<td  align='center' class=\"bold\">\n\t\t\t\t\t{$gb6_display}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$filesys6}</span>'\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$mount6}</span>'\n\t\t\t\t</td>\n\t\t\t\t<!td>\n\t\t\t\t\t{$location6}\n\t\t\t\t</td-->\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"{$input_class}\">{$input_mount}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"data\" style=\"background-color:{$color2}\">\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#section2\"><span class=\"plaintext largerfont\">{$dataDir}</span></a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\tOutput data and copies of input data;\n\t\t\t\t</td>\n\t\t\t\t<td align='center'  class=\"bold alertnotice\">\n\t\t\t\t\t10x\n\t\t\t\t</td>\n\t\t\t\t<td align='center' class=\"bold\">\n\t\t\t\t\t{$gb2_display}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$filesys2}</span>'\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$mount2}</span>'\n\t\t\t\t</td>\n\t\t\t\t<!td>\n\t\t\t\t\t{$location2}\n\t\t\t\t</td-->\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"{$data_class}\">{$data_mount}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"scratch\" style=\"background-color:{$color3}\">\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#section3\"><span class=\"plaintext largerfont\">{$dataDir}/scratch/</span></a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t(temporary) copies of input data during pipeline operation\n\t\t\t\t</td>\n\t\t\t\t<td align='center'  class=\"bold alertnotice\">\n\t\t\t\t\t2x\n\t\t\t\t</td>\n\t\t\t\t<td  align='center' class=\"bold\">\n\t\t\t\t\t{$gb3_display}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$filesys3}</span>'\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$mount3}</span>'\n\t\t\t\t</td>\n\t\t\t\t<!td>\n\t\t\t\t\t{$location3}\n\t\t\t\t</td-->\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"{$scratch_class}\">{$scratch_valid}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"mysql\" style=\"background-color:{$color4}\">\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#section4\"><span class=\"plaintext largerfont\">{$dataDir}/mysql/</span></a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\tMySQL data tables\n\t\t\t\t</td>\n\t\t\t\t<td align='center' class=\"bold alertnotice\">\n\t\t\t\t\t1x\n\t\t\t\t</td>\n\t\t\t\t<td  align='center' class=\"bold\">\n\t\t\t\t\t{$gb4_display}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$filesys4}</span>'\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$mount4}</span>'\n\t\t\t\t</td>\n\t\t\t\t<!td>\n\t\t\t\t\t{$location4}\n\t\t\t\t</td-->\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"{$mysql_class}\">{$mysql_valid}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"tmp\" style=\"background-color:{$color5}\">\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#section5\"><span class=\"plaintext largerfont\">{$dataDir}/tmp/</span></a> \n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\tCached images and data files from web browser activity\n\t\t\t\t</td>\n\t\t\t\t<td align='center' class=\"bold alertnotice\">\n\t\t\t\t\t1x\n\t\t\t\t</td>\n\t\t\t\t<td  align='center' class=\"bold\">\n\t\t\t\t\t{$gb5_display}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$filesys5}</span>'\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t'<span class=\"plaintext largerfont\">{$mount5}</span>'\n\t\t\t\t</td>\n\t\t\t\t<!td>\n\t\t\t\t\t{$location5}\n\t\t\t\t</td-->\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"{$tmp_class}\">{$tmp_valid}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t";
 $i_payment = $_POST['i_payment'];
 $i_change = $_POST['i_change'];
 $i_discount = $_POST['i_discount'];
 $i_discount_persen = $_POST['i_discount_persen'];
 $i_grand_total = $_POST['i_grand_total'];
 $i_payment_method = $_POST['i_payment_method'];
 $i_bank_id = "";
 $i_bank_account = "";
 if ($i_payment_method == 2 || $i_payment_method == 3) {
     $i_bank_id = $_POST['i_bank_id'];
     $i_bank_account = $_POST['i_bank_account'];
 }
 $table_id = $_GET['table_id'];
 $building_id = $_GET['building_id'];
 $branch_id = get_branch_id($building_id);
 $data_total = get_data_total($table_id);
 $total_discount = get_total_discount($table_id);
 //echo $total_discount;
 update_table_status($table_id);
 if ($i_payment < $i_grand_total) {
     header("location: payment.php?table_id={$table_id}&building_id={$building_id}&err=1");
 } else {
     $query = mysql_query("select * \n\t\t\t\t\t\t\t\tfrom transactions_tmp a\n\t\t\t\t\t\t\t\twhere a.table_id = '{$table_id}'\n\t\t\t\t\t\t\t\t");
     // simpan transaksi
     while ($row = mysql_fetch_array($query)) {
         // create settlement
         $get_discount_type = get_discount_type($row['member_id']);
         if ($total_discount > 0 && $get_discount_type == 2) {
             update_settlement($total_discount, $row['member_id']);
         }
         $data = "'',\n\t\t\t\t\t'{$table_id}',\n\t\t\t\t\t'{$branch_id}',\n\t\t\t\t\t'" . $row['member_id'] . "',\n\t\t\t\t\t'" . $row['transaction_date'] . "', \n\t\t\t\t\t'" . $data_total . "',\n\t\t\t\t\t'" . $i_discount . "',\n\t\t\t\t\t'" . $i_grand_total . "',\n\t\t\t\t\t'" . $i_payment . "',\n\t\t\t\t\t'" . $i_change . "',\n\t\t\t\t\t'" . $i_payment_method . "',\n\t\t\t\t\t'" . $i_bank_id . "',\n\t\t\t\t\t'" . $row['user_id'] . "',\n\t\t\t\t\t'" . $i_bank_account . "',\n\t\t\t\t\t'" . $row['transaction_code'] . "',\n\t\t\t\t\t'" . $row['customer_number'] . "',\n\t\t\t\t\t'" . $row['tot_id'] . "',\n\t\t\t\t\t'" . $i_discount_persen . "'\n\t\t\t\t\t\n\t\t\t";