Example #1
0
         break;
     case "repou":
         $ord = 'R.description';
         break;
     case "repod":
         $ord = 'R.description desc';
         break;
     case "locu":
         $ord = 'P.location';
         break;
     case "locd":
         $ord = 'P.location desc';
         break;
 }
 $pkg = new package();
 $nres = $pkg->find($sname, $sdesc, $repo, $ord);
 if (isset($_GET['debug'])) {
     var_dump($pkg, $nres);
 }
 $to = $start + $maxresult;
 if ($to > $nres) {
     $to = $nres;
 }
 $duration = round($pkg->db->msec / 1000, 3);
 echo "Time: {$duration} msec<br />";
 echo "Results " . ($start + 1) . "-{$to} of {$nres}:                    ";
 if ($start > 0) {
     echo "<a href='index.php?start=0&maxresult={$maxresult}&repo={$repo}&name={$name}&desc={$desc}&file={$file}&order={$order}#results'>&lt;&lt;</a>  ";
     $from = $start - $maxresult;
     if ($from < 0) {
         $from = 0;
Example #2
0
         $ord = 'P.location';
         break;
     case "locd":
         $ord = 'P.location desc';
         break;
 }
 $pkg = new package();
 $xml = new xml('searcher', array('version' => '0.1'));
 $xml->startSection('info');
 $xml->startSection('query');
 $xml->setElement('field', $name, array('name' => 'name', 'description' => 'package name'));
 $xml->setElement('field', $desc, array('name' => 'desc', 'descriprion' => 'package description'));
 $xml->setElement('field', $desc, array('name' => 'file', 'descriprion' => 'file name'));
 $xml->endSection();
 $xml->endSection();
 $nres = $pkg->find($name, $desc, $repo, $ord);
 $xml->startSection('results', array('count' => $nres));
 $to = $start + $maxresult;
 if ($to > $nres) {
     $to = $nres;
 }
 if ($start > 0) {
     $from = $start - $maxresult;
     if ($from < 0) {
         $from = 0;
     }
 }
 if ($to < $nres) {
     $pg = round($nres / $maxresult - 0.5, 0);
     $from = $start + $maxresult;
     $from = $maxresult * $pg;
 /**
  * Remove the specified resource from storage.
  *
  * @param $package
  * @return Response
  */
 public function postDelete(DeleteRequest $request, $id)
 {
     $package = package::find($id);
     $package->delete();
     return redirect('admin/packages');
 }